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

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

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    animation: slideDown 0.8s ease-out;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.logo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    border-radius: 12px;
    min-width: 120px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 8px;
    background: white;
    padding: 5px;
}

.nsbm-logo {
    border: 2px solid #4CAF50;
}

.plymouth-logo {
    border: 2px solid #003366;
}

.logo-placeholder i {
    font-size: 2rem;
    display: none; /* Hide icons when using real logos */
}

.logo-placeholder span {
    font-weight: bold;
    font-size: 0.85rem;
    text-align: center;
    color: #333;
}

.partnership-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 0.8rem;
}

.partnership-text i {
    font-size: 1.2rem;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 25%;
    transition: width 0.5s ease;
    border-radius: 3px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.step.active {
    color: white;
    transform: scale(1.1);
}

.step i {
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.step.active i {
    background: rgba(255, 255, 255, 0.2);
}

/* Form Styles */
.form-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.form-step {
    display: none;
    animation: fadeInSlide 0.6s ease-out;
}

.form-step.active {
    display: block;
}

.form-step h2 {
    color: #333;
    margin-bottom: 30px;
    font-size: 1.8rem;
    text-align: center;
    position: relative;
}

.form-step h2::after {
    content: '';
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.form-group input::placeholder {
    color: #aaa;
}

/* Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 15px;
    border-radius: 12px;
    border: 2px solid #e1e5e9;
    background: #fafbfc;
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    border-color: #667eea;
    background: white;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkmark {
    font-weight: 500;
    color: #555;
}

/* Button Styles */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* Module Entry Styles */
.year-section {
    margin-bottom: 40px;
    padding: 25px;
    border: 2px solid #e1e5e9;
    border-radius: 15px;
    background: #fafbfc;
}

.year-title {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.semester-section {
    margin-bottom: 30px;
}

.semester-title {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.module-count-input {
    margin-bottom: 20px;
}

.module-inputs {
    display: grid;
    gap: 15px;
}

.module-input-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    align-items: end;
}

.module-input-row input {
    margin-bottom: 0;
}

/* Results Styles */
.results-container {
    display: grid;
    gap: 25px;
}

.student-info-card,
.gpa-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #dee2e6;
}

.student-info-card h3,
.gpa-card h3 {
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.info-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.label {
    font-weight: 600;
    color: #555;
}

.value {
    color: #333;
    font-weight: 500;
}

.gpa-display {
    text-align: center;
    margin-bottom: 20px;
}

.gpa-value {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.gpa-percentage {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 15px;
}

.classification {
    text-align: center;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.classification.first-class {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #8b7300;
}

.classification.upper-second {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #666;
}

.classification.lower-second {
    background: linear-gradient(135deg, #cd7f32, #daa560);
    color: #654321;
}

.classification.third-class {
    background: linear-gradient(135deg, #bc8f8f, #d2b48c);
    color: #704214;
}

.classification.fail {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.modules-summary {
    background: #ffffff;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #dee2e6;
}

.modules-summary h3 {
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
}

.year-modules {
    margin-bottom: 25px;
}

.year-modules:last-child {
    margin-bottom: 0;
}

.year-modules h4 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.module-list {
    display: grid;
    gap: 8px;
}

.module-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.module-name {
    font-weight: 500;
    color: #333;
}

.module-mark {
    font-weight: 600;
    color: #667eea;
}

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

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-out-left {
    animation: slideOutLeft 0.4s ease-in forwards;
}

.slide-in-right {
    animation: slideInRight 0.4s ease-out forwards;
}

.slide-out-right {
    animation: slideOutRight 0.4s ease-in forwards;
}

.slide-in-left {
    animation: slideInLeft 0.4s ease-out forwards;
}

@keyframes slideOutLeft {
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        padding: 20px;
    }
    
    .logo-container {
        gap: 15px;
    }
    
    .logo-placeholder {
        min-width: 100px;
        padding: 12px;
    }
    
    .logo-img {
        width: 100px;
        height: 100px;
    }
    
    .logo-placeholder span {
        font-size: 0.75rem;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .form-container {
        padding: 25px;
    }
    
    .form-step h2 {
        font-size: 1.5rem;
    }
    
    .progress-steps {
        gap: 10px;
    }
    
    .step {
        font-size: 0.7rem;
    }
    
    .step i {
        font-size: 1rem;
        padding: 6px;
    }
    
    .module-input-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        min-width: 200px;
        justify-content: center;
    }
    
    .gpa-value {
        font-size: 2.5rem;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .module-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .logo-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .partnership-text {
        order: 2;
    }
    
    .logo-placeholder {
        min-width: 140px;
        padding: 10px;
    }
    
    .logo-img {
        width: 45px;
        height: 45px;
    }
    
    .main-title {
        font-size: 1.8rem;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .gpa-value {
        font-size: 2rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .progress-container,
    .button-group {
        display: none;
    }
    
    .form-container {
        background: white;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .header {
        background: white;
        box-shadow: none;
        border-bottom: 2px solid #ddd;
    }
    
    .logo-placeholder {
        border: 1px solid #ddd;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dark Mode Variables */
:root {
    --bg-color: #f8f9fa;
    --text-color: #333;
    --card-bg: #ffffff;
    --border-color: #dee2e6;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.dark-mode {
    --bg-color: #1a1a2e;
    --text-color: #f8f9fa;
    --card-bg: rgba(22, 33, 62, 0.95);
    --border-color: #2d4059;
    --primary-gradient: linear-gradient(135deg, #4a00e0 0%, #8e2de2 100%);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toggle-checkbox {
    display: none;
}

.toggle-label {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    background-color: #ccc;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-label i {
    position: absolute;
    top: 6px;
    font-size: 18px;
    transition: all 0.3s ease;
}

.toggle-label .fa-sun {
    left: 6px;
    color: #f1c40f;
}

.toggle-label .fa-moon {
    right: 6px;
    color: #34495e;
}

.toggle-ball {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-checkbox:checked + .toggle-label {
    background-color: #4a00e0;
}

.toggle-checkbox:checked + .toggle-label .toggle-ball {
    transform: translateX(30px);
}

/* Chart Container */
.chart-container {
    margin-top: 30px;
    height: 250px;
    width: 100%;
}

/* Enhanced Module Items with Grade Colors */
.module-item {
    position: relative;
    overflow: hidden;
}

.module-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
}

.module-item.excellent {
    border-left-color: #2ecc71;
}
.module-item.good {
    border-left-color: #3498db;
}
.module-item.average {
    border-left-color: #f39c12;
}
.module-item.poor {
    border-left-color: #e74c3c;
}

/* Print Specific Styles */
@media print {
    .dark-mode-toggle {
        display: none;
    }
    
    .chart-container {
        page-break-inside: avoid;
        height: 300px;
    }
    
    .results-container {
        display: block;
    }
    
    .gpa-card, .student-info-card {
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
    
    @page {
        size: auto;
        margin: 10mm;
    }
}

/* Smoother Transitions */
.form-step {
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.slide-out-left {
    animation: slideOutLeft 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.slide-in-right {
    animation: slideInRight 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.slide-out-right {
    animation: slideOutRight 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.slide-in-left {
    animation: slideInLeft 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* Enhanced Dark Mode Styles */
.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.dark-mode body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #f8f9fa;
}

.dark-mode .header, 
.dark-mode .form-container, 
.dark-mode .student-info-card, 
.dark-mode .gpa-card, 
.dark-mode .modules-summary, 
.dark-mode .year-section {
    background: rgba(22, 33, 62, 0.95);
    border-color: #2d4059;
    color: #f8f9fa;
}

.dark-mode .form-step h2,
.dark-mode .year-title,
.dark-mode .semester-title,
.dark-mode .student-info-card h3,
.dark-mode .gpa-card h3,
.dark-mode .modules-summary h3,
.dark-mode .year-modules h4 {
    color: #f8f9fa;
}

.dark-mode .form-group label,
.dark-mode .label,
.dark-mode .value,
.dark-mode .checkmark {
    color: #f8f9fa;
}

.dark-mode .form-group input,
.dark-mode .form-group select,
.dark-mode .checkbox-label {
    background: rgba(22, 33, 62, 0.8);
    border-color: #2d4059;
    color: #f8f9fa;
}

.dark-mode .form-group input::placeholder {
    color: #adb5bd;
}

.dark-mode .form-group input:focus,
.dark-mode .form-group select:focus {
    background: rgba(22, 33, 62, 0.9);
    border-color: #4a00e0;
    box-shadow: 0 0 0 3px rgba(74, 0, 224, 0.2);
}

.dark-mode .checkbox-label:hover {
    border-color: #4a00e0;
    background: rgba(22, 33, 62, 0.9);
}

.dark-mode .module-item,
.dark-mode .info-row {
    background: rgba(22, 33, 62, 0.6);
    border-color: #2d4059;
    color: #f8f9fa;
}

.dark-mode .module-name,
.dark-mode .module-mark {
    color: #f8f9fa;
}

.dark-mode .module-mark {
    color: #8e2de2;
}

.dark-mode .info-row {
    border-bottom-color: #2d4059;
}

.dark-mode .logo-placeholder span,
.dark-mode .partnership-text {
    color: #f8f9fa;
}

.dark-mode .gpa-percentage {
    color: #adb5bd;
}

.dark-mode .student-info-card,
.dark-mode .gpa-card {
    background: linear-gradient(135deg, rgba(22, 33, 62, 0.95), rgba(26, 26, 46, 0.95));
}

.dark-mode .modules-summary {
    background: rgba(22, 33, 62, 0.95);
}

.dark-mode .year-section {
    background: rgba(22, 33, 62, 0.6);
}

/* Ensure buttons maintain their colors in dark mode */
.dark-mode .btn-primary,
.dark-mode .btn-secondary,
.dark-mode .btn-success {
    color: white;
}