/* CSS Variables */
:root {
    --cmu-red: #A80C1E;
    --gold-accent: #C6A667;
    --white: #FFFFFF;
    --light-gray: #F5F5F5;
    --gray-border: #CCCCCC;
    --dark-gray: #333333;
    --blue-icon: #4A90E2;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--white);
    color: var(--dark-gray);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
}

/* Header Section */
.header {
    background-color: var(--cmu-red);
    color: var(--white);
    padding: 1.5rem 2rem;
    position: relative;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.title-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

.title-link:hover {
    opacity: 0.9;
}

.title {
    font-size: 2.5rem;
    font-weight: bold;
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.title-main {
    color: var(--white);
}

.title-accent {
    color: var(--gold-accent);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: bold;
    font-size: 1.1rem;
}

.nav-link {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--gold-accent);
}

.nav-link.active {
    color: var(--gold-accent);
}

.nav-separator {
    color: var(--white);
}

.info-icon {
    font-size: 1.2rem;
    cursor: pointer;
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
}

/* Dropdown Panels */
.dropdown-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    padding: 0 1rem;
}

.dropdown-panel.active {
    max-height: 500px;
    padding: 1rem 1rem 1.5rem;
}

.panel-content {
    opacity: 0;
    transition: opacity 0.3s ease-in 0.1s;
}

.dropdown-panel.active .panel-content {
    opacity: 1;
}

.info-list {
    list-style: none;
    padding-left: 0;
}

.info-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--white);
    font-size: 1rem;
}

.info-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--white);
}

.info-list li a {
    color: var(--gold-accent);
    text-decoration: underline;
    transition: color 0.2s;
}

.info-list li a:hover {
    color: var(--white);
    text-decoration: underline;
}

/* Triangle Separator */
.triangle-separator {
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid var(--cmu-red);
    margin: 0 auto;
    position: relative;
    top: 1px;
}

/* Main Content Section */
.main-content {
    background-color: var(--white);
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 300px);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

/* Summary Statistics */
.summary-stats {
    display: flex;
    
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-border);
    
}

.stat-item {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.stat-label {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--dark-gray);
}

.stat-value {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--dark-gray);
}

/* Course Rows */
.courses-container {
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.course-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: var(--white);
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.course-row.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

/* Course Toggle (Drop Simulation) */
.course-toggle {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 2px solid var(--blue-icon);
    background-color: var(--blue-icon);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.25);
}

.course-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 6px rgba(74, 144, 226, 0.35);
}

.course-toggle.inactive {
    background-color: var(--white);
    border-color: var(--gray-border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.course-toggle.inactive:hover {
    border-color: var(--dark-gray);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Beautiful checkmark for active state */
.course-toggle::before {
    content: '✓';
    position: absolute;
    color: var(--white);
    font-size: 1.1rem;
    font-weight: bold;
    line-height: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: scale(1);
    top: 50%;
    left: 50%;
    margin-left: -0.5em;
    margin-top: -0.5em;
}

/* Hide checkmark when inactive */
.course-toggle.inactive::before {
    opacity: 0;
    transform: scale(0.5);
}

/* Remove the ::after pseudo-element since we're using a single character */
.course-toggle::after {
    content: none;
}

/* Course Code Input */
.course-code {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    background-color: var(--light-gray);
    font-size: 0.95rem;
    width: 100px;
    text-align: center;
    font-weight: 500;
    height: 2.75rem;
    box-sizing: border-box;
    line-height: 1.2;
}

.course-code:focus {
    outline: none;
    border-color: var(--blue-icon);
    background-color: var(--white);
}

/* Units Control */
.units-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    background-color: var(--light-gray);
    height: 2.75rem;
    box-sizing: border-box;
}

.units-btn {
    width: 24px;
    height: 24px;
    border: none;
    background-color: transparent;
    color: var(--dark-gray);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.units-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.units-value {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    text-align: center;
    font-weight: 500;
    font-size: 0.95rem;
    border: none;
    background-color: transparent;
    padding: 0;
    outline: none;
    cursor: text;
    box-sizing: border-box;
}

.units-value:focus {
    background-color: var(--white);
    border-radius: 4px;
    padding: 0.125rem 0.25rem;
    box-sizing: border-box;
}

/* Grade Dropdown */
.grade-select {
    padding: 0 2.25rem 0 2.25rem;
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    background-color: var(--light-gray);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    min-width: 80px;
    height: 2.75rem;
    box-sizing: border-box;
    line-height: 2.75rem;
    text-align: center;
    text-indent: 0;
}

.grade-select:focus {
    outline: none;
    border-color: var(--blue-icon);
    background-color: var(--white);
}

/* Action Buttons */
.action-btn {
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    background-color: var(--light-gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.action-btn:hover {
    background-color: var(--gray-border);
    box-shadow: var(--shadow);
}

.delete-btn::before {
    content: '🗑';
    font-size: 1rem;
}

.drag-handle {
    cursor: move;
}

.drag-handle::before {
    content: '⋯';
    font-size: 1.5rem;
    line-height: 1;
    color: var(--dark-gray);
    display: block;
    transform: rotate(90deg);
}

/* Add Button */
.add-button {
    display: block;
    margin: 2rem auto 0;
    padding: 0.75rem 2rem;
    background-color: var(--light-gray);
    border: 1px solid var(--dark-gray);
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    color: var(--dark-gray);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.add-button:hover {
    background-color: var(--gray-border);
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

.add-button:active {
    transform: translateY(0);
}

/* Empty State */
.empty-state {
    text-align: center;
    color: var(--dark-gray);
    padding: 3rem 1rem;
    opacity: 0.6;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.course-row {
    animation: fadeIn 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 1.5rem 1rem 0.75rem;
    }

    .header-top {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .title {
        font-size: 1.75rem;
    }

    .nav-menu {
        font-size: 0.9rem;
        gap: 0.5rem;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 0.25rem 0.4rem;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

    .summary-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        width: 100%;
    }

    .courses-container {
        align-items: stretch;
    }

    .course-row {
        width: 100%;
        flex-wrap: nowrap;
        gap: 0.5rem;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        padding: 0.75rem 0.5rem;
        min-width: 0;
    }

    .course-row::-webkit-scrollbar {
        display: none;
    }

    .course-row {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .course-toggle {
        width: 2.25rem;
        height: 2.25rem;
        flex-shrink: 0;
    }

    .course-code {
        width: 90px;
        min-width: 90px;
        max-width: 90px;
        font-size: 0.85rem;
        padding: 0.5rem 0.5rem;
    }

    .units-control {
        min-width: 100px;
        flex-shrink: 0;
        padding: 0.5rem 0.5rem;
        gap: 0.4rem;
    }

    .units-btn {
        width: 22px;
        height: 22px;
        font-size: 1rem;
    }

    .units-value {
        width: 60px;
        min-width: 60px;
        max-width: 60px;
        font-size: 0.85rem;
    }

    .grade-select {
        min-width: 70px;
        flex-shrink: 0;
        font-size: 0.85rem;
        padding: 0 1.75rem 0 0.75rem;
        background-position: right 0.5rem center;
    }

    .action-btn {
        width: 2.25rem;
        height: 2.25rem;
        flex-shrink: 0;
    }

    .delete-btn::before {
        font-size: 0.9rem;
    }

    .drag-handle::before {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1rem 0.75rem 0.5rem;
    }

    .title {
        font-size: 1.5rem;
    }

    .nav-menu {
        font-size: 0.85rem;
        gap: 0.4rem;
    }

    .nav-link {
        font-size: 0.85rem;
        padding: 0.2rem 0.3rem;
    }

    .main-content {
        padding: 1rem 0.75rem;
    }

    .summary-stats {
        gap: 0.75rem;
        padding-bottom: 1rem;
    }

    .stat-label,
    .stat-value {
        font-size: 1rem;
    }

    .course-row {
        gap: 0.4rem;
        padding: 0.75rem 0.4rem;
    }

    .course-toggle {
        width: 2rem;
        height: 2rem;
    }

    .course-toggle::before {
        font-size: 1rem;
    }

    .course-code {
        width: 80px;
        min-width: 80px;
        max-width: 80px;
        font-size: 0.8rem;
        padding: 0.45rem 0.4rem;
    }

    .units-control {
        min-width: 90px;
        padding: 0.45rem 0.4rem;
        gap: 0.3rem;
    }

    .units-btn {
        width: 20px;
        height: 20px;
        font-size: 0.9rem;
    }

    .units-value {
        width: 55px;
        min-width: 55px;
        max-width: 55px;
        font-size: 0.8rem;
    }

    .grade-select {
        min-width: 65px;
        font-size: 0.8rem;
        padding: 0 1.5rem 0 0.6rem;
    }

    .action-btn {
        width: 2rem;
        height: 2rem;
    }

    .add-button {
        padding: 0.65rem 1.5rem;
        font-size: 0.95rem;
    }
}