/* ============================================
   GRADE CALCULATOR STYLES
   ============================================ */

/* Container for calculator */
.container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--color-bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
    border: 1px solid #233554;
}

.header {
    padding: 48px 40px 40px;
    background: linear-gradient(135deg, #0A192F 0%, #112240 100%);
    position: relative;
    overflow: hidden;
    color: var(--color-text-heading);
    text-align: center;
    border-bottom: 1px solid #233554;
}

.header .language-switcher {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.header .lang-btn {
    padding: 6px 12px;
    background: rgba(255, 128, 0, 0.1);
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-family: var(--font-code);
}

.header .lang-btn:hover {
    background: rgba(255, 128, 0, 0.2);
    border-color: var(--color-accent-hover);
}

.header .lang-btn.active {
    background: var(--color-accent);
    color: var(--color-bg-deep);
    border-color: var(--color-accent);
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    font-family: var(--font-display);
}

.header p {
    font-size: 16px;
    opacity: 0.9;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    color: var(--color-text-muted);
}

.content {
    padding: 40px;
}

/* Sections */
.section {
    margin-bottom: 36px;
    padding-bottom: 36px;
    border-bottom: 1px solid #233554;
    animation: fadeIn 0.5s ease-out backwards;
}

.section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section .section-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--color-accent);
    font-family: var(--font-code);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: left;
}

.section-info {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-left: 8px;
}

/* Add Button */
.add-btn {
    background: var(--color-accent);
    color: var(--color-bg-deep);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 128, 0, 0.3);
    transition: all 0.3s ease;
    font-weight: 700;
    margin: 4px;
    margin-left: 8px;
}

.add-btn:hover {
    transform: scale(1.1);
    background: var(--color-accent-hover);
}

/* Grades Grid */
.grades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
    margin-top: 15px;
}

.grade-item {
    background: #0d1f3a;
    border-radius: var(--radius-md);
    padding: 8px 6px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid #233554;
    color: var(--color-text-heading);
}

.grade-item.green {
    background: rgba(76, 175, 80, 0.1);
    border-color: #4CAF50;
}

.grade-item.orange {
    background: rgba(255, 128, 0, 0.1);
    border-color: var(--color-accent);
}

.grade-item.red {
    background: rgba(244, 67, 54, 0.1);
    border-color: #f44336;
}

.grade-item input {
    width: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    outline: none;
    color: var(--color-text-heading);
}

/* Remove Button */
.remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--color-accent);
    color: var(--color-bg-deep);
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
    font-weight: 700;
}

.remove-btn:hover {
    background: var(--color-accent-hover);
    transform: scale(1.1);
}

.grade-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    opacity: 0;
    transform: scale(0.8);
    width: 20px;
    height: 20px;
    font-size: 12px;
}

.grade-item:hover .remove-btn {
    opacity: 1;
    transform: scale(1);
}

/* Test & Final Items */
.test-item, .final-item {
    background: #0d1f3a;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    border: 1px solid #233554;
    position: relative;
}

.test-item .remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    opacity: 1;
    transform: scale(1);
    width: 24px;
    height: 24px;
    font-size: 14px;
}

.test-item .remove-btn:hover {
    background: var(--color-accent-hover);
    transform: scale(1.1);
}

/* Assignment Subsection */
.assignment-subsection {
    background: #0d1f3a;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 12px;
    border: 1px solid #233554;
    transition: all 0.3s ease;
    position: relative;
}

.assignment-subsection .remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    opacity: 1;
    transform: scale(1);
    width: 24px;
    height: 24px;
    font-size: 14px;
}

.assignment-subsection .remove-btn:hover {
    background: var(--color-accent-hover);
    transform: scale(1.1);
}

.assignment-subsection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #233554;
}

.assignment-subsection-name {
    background: transparent;
    border: 1px solid #233554;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--color-text-heading);
    font-weight: 600;
    width: 200px;
    font-family: var(--font-body);
}

.assignment-subsection-name:focus {
    outline: none;
    border-color: var(--color-accent);
}

.assignment-subsection-weight {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-text-muted);
}

.assignment-subsection-weight input {
    width: 60px;
    background: transparent;
    border: 1px solid #233554;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    color: var(--color-accent);
    font-weight: 600;
    font-family: var(--font-code);
    text-align: center;
}

.assignment-subsection-weight input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.assignment-subsection-grades {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
}

/* Responsive */
@media (max-width: 786px) {
    .content {
        padding: 20px;
    }

    .header {
        padding: 30px 20px 20px;
    }

    .header h1 {
        font-size: 22px;
    }

    .header p {
        font-size: 14px;
    }

    .grades-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }

    .grade-item {
        padding: 6px 4px;
    }
}
