* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Main Navigation */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.main-nav .nav-link {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.main-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.main-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    border-color: rgba(255, 255, 255, 0.9);
}

main {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #718096;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background: #e2e8f0;
    color: #4a5568;
}

.tab-button.active {
    background: white;
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-section, .results-section, .history-section {
    padding: 30px;
}

.form-section h2, .results-section h2, .history-section h2 {
    color: #4a5568;
    margin-bottom: 25px;
    font-size: 1.8rem;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    color: #718096;
    font-size: 0.9rem;
    margin-top: 5px;
    display: block;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.checkbox-group label:hover {
    background-color: #f7fafc;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.subject-item {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.subject-item .subject-name {
    flex: 2;
}

.subject-item .subject-weight {
    flex: 1;
    max-width: 100px;
}

.remove-subject {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.remove-subject:hover {
    background: #c53030;
}

.add-subject-btn {
    background: #38a169;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

.add-subject-btn:hover {
    background: #2f855a;
}

.generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    margin-top: 20px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.export-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.export-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.export-btn.excel {
    background: #16a085;
    color: white;
}

.export-btn.pdf {
    background: #e74c3c;
    color: white;
}

.export-btn.save {
    background: #f39c12;
    color: white;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

#scheduleTable {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: #e3f2fd;
}

.subject-cell {
    font-weight: 600;
    color: #4a5568;
}

.hours-cell {
    text-align: center;
    font-weight: 600;
    color: #667eea;
}

.saved-schedule-item {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: box-shadow 0.3s ease;
}

.saved-schedule-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.saved-schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.saved-schedule-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
}

.saved-schedule-date {
    color: #718096;
    font-size: 0.9rem;
}

.saved-schedule-info {
    color: #4a5568;
    margin-bottom: 15px;
}

.saved-schedule-actions {
    display: flex;
    gap: 10px;
}

.saved-schedule-actions button {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.load-schedule {
    background: #667eea;
    color: white;
}

.delete-schedule {
    background: #e53e3e;
    color: white;
}

.saved-schedule-actions button:hover {
    opacity: 0.9;
}

/* Guide Section Styles */
.guide-section {
    padding: 30px;
}

.guide-content {
    max-width: 1000px;
    margin: 0 auto;
}

.guide-section-item {
    margin-bottom: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.guide-section-item h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.guide-section-item h4 {
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.guide-section-item p {
    margin-bottom: 15px;
    line-height: 1.7;
    color: #4a5568;
}

.guide-section-item ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.guide-section-item li {
    margin-bottom: 8px;
    color: #4a5568;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.feature-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #38a169;
}

.feature-card h4 {
    color: #2d3748;
    margin-bottom: 10px;
}

.feature-card p {
    color: #4a5568;
    margin-bottom: 0;
}

/* Config Items */
.config-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.config-item h4 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.example-box, .tip-box {
    background: #e6fffa;
    border: 1px solid #81e6d9;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
    color: #234e52;
}

.tip-box {
    background: #fef5e7;
    border-color: #f6ad55;
    color: #744210;
}

/* Weight Explanation */
.weight-explanation {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.example-calculation {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.calculation-box {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    margin-top: 15px;
}

.calculation-box ul {
    margin: 10px 0;
}

.calculation-box li {
    margin-bottom: 5px;
}

/* Algorithm Steps */
.algorithm-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.step {
    display: flex;
    align-items: flex-start;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    margin-right: 15px;
    flex-shrink: 0;
}

.step-content h4 {
    margin-bottom: 8px;
    color: #2d3748;
}

.step-content p {
    margin-bottom: 0;
    color: #4a5568;
    font-size: 14px;
}

/* Export Options */
.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.export-option {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-top: 4px solid #667eea;
}

.export-option h4 {
    color: #2d3748;
    margin-bottom: 15px;
}

.export-option ul {
    margin-left: 20px;
}

.export-option li {
    margin-bottom: 8px;
    color: #4a5568;
}

/* Tips Grid */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tip-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #38a169;
}

.tip-card h4 {
    color: #2d3748;
    margin-bottom: 10px;
}

.tip-card p {
    margin-bottom: 0;
    color: #4a5568;
    font-size: 14px;
}

/* FAQ */
.faq {
    margin-top: 20px;
}

.faq-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #f6ad55;
}

.faq-item h4 {
    color: #2d3748;
    margin-bottom: 10px;
}

.faq-item p {
    margin-bottom: 0;
    color: #4a5568;
}

/* Getting Started */
.getting-started {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.getting-started ol {
    margin-left: 20px;
    margin-bottom: 25px;
}

.getting-started li {
    margin-bottom: 10px;
    color: #4a5568;
    line-height: 1.6;
}

.cta-box {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
}

.cta-box p {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: white !important;
}

.cta-button {
    background: white;
    color: #667eea;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Footer Styles */
.site-footer {
    background: white;
    padding: 30px 20px;
    margin-top: 40px;
    border-top: 1px solid #e2e8f0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-text {
    color: #4a5568;
    font-size: 16px;
    margin-bottom: 20px;
    font-weight: 500;
}

.footer-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.footer-btn {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-btn:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.faq-btn {
    position: relative;
}

.faq-btn::before {
    content: "?";
    background: #667eea;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    margin-right: 8px;
}

.coffee-btn {
    position: relative;
}

.coffee-btn::before {
    content: "☕";
    font-size: 16px;
    margin-right: 8px;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .form-section, .results-section, .history-section {
        padding: 20px;
    }
    
    .checkbox-group {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .subject-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .subject-item .subject-name,
    .subject-item .subject-weight {
        flex: none;
        max-width: none;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    .export-btn {
        width: 100%;
    }
    
    .saved-schedule-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .saved-schedule-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .saved-schedule-actions button {
        flex: 1;
    }
    
    /* Guide responsive */
    .tab-button {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .guide-section-item {
        padding: 20px;
        margin-bottom: 30px;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .algorithm-steps {
        grid-template-columns: 1fr;
    }
    
    .export-options {
        grid-template-columns: 1fr;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    /* Footer responsive */
    .footer-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .footer-btn {
        width: 200px;
        justify-content: center;
    }
    
    /* Main nav responsive */
    .main-nav {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .main-nav .nav-link {
        width: 200px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 8px 10px;
    }
}
