/* 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;
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    right: 0;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: bold;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 0 0 0 20px;
    transition: all 0.3s ease;
}

.header:hover {
    background: rgba(255, 255, 255, 0.2);
}

.app-icon {
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #667eea;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Landing Page Styles */
.landing-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 20px;
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.main-icon {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    color: #667eea;
    margin-bottom: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.slogan {
    color: white;
    font-size: 2.8rem;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: slideInUp 1s ease-out 0.3s both;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    margin-bottom: 40px;
    animation: slideInUp 1s ease-out 0.6s both;
}

.start-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 18px 45px;
    font-size: 1.3rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    animation: slideInUp 1s ease-out 0.9s both;
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    background: #f8f9ff;
}

.start-btn:active {
    transform: translateY(-1px);
}

/* Calculator Page Styles */
.calculator-page {
    display: none;
    min-height: 100vh;
    padding: 80px 20px 40px;
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    color: #444;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-weight: bold;
    color: #555;
    font-size: 1.1rem;
}

.label-icon {
    margin-right: 8px;
    font-size: 1.2rem;
}

.help-text {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
    margin-top: 5px;
}

input[type="number"],
input[type="text"],
select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* Semester Styles */
.semesters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.semester-section {
    background: #f8f9ff;
    padding: 25px;
    border-radius: 18px;
    margin-bottom: 25px;
    border: 2px solid #e0e6ff;
    transition: all 0.3s ease;
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.semester-section:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.semester-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.semester-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Course Entry Styles */
.course-entry {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 12px;
    margin-bottom: 15px;
    align-items: end;
    padding: 15px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.course-entry:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: #667eea;
}

.course-entry input, .course-entry select {
    margin-bottom: 0;
    padding: 12px;
}

/* Button Styles */
.btn-icon {
    margin-right: 8px;
    font-size: 1.1rem;
}

button {
    font-family: inherit;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    text-decoration: none;
}

.add-semester-btn, .add-course-btn {
    background: linear-gradient(135deg, #667eea, #5a67d8);
    color: white;
    padding: 12px 20px;
    font-size: 16px;
    margin: 5px;
}

.add-semester-btn:hover, .add-course-btn:hover {
    background: linear-gradient(135deg, #5a67d8, #4c51bf);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.remove-course-btn, .remove-semester-btn {
    background: linear-gradient(135deg, #ff4757, #ff3838);
    color: white;
    padding: 8px 15px;
    font-size: 14px;
}

.remove-course-btn:hover, .remove-semester-btn:hover {
    background: linear-gradient(135deg, #ff3838, #ff2f2f);
    transform: translateY(-1px);
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    font-size: 16px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.calculate-btn {
    flex: 2;
    padding: 18px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    min-width: 200px;
}

.calculate-btn:hover {
    background: linear-gradient(135deg, #20c997, #17a2b8);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(40, 167, 69, 0.4);
}

.reset-btn {
    flex: 1;
    padding: 18px;
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    font-size: 1.1rem;
    min-width: 120px;
}

.reset-btn:hover {
    background: linear-gradient(135deg, #5a6268, #495057);
    transform: translateY(-2px);
}

/* Loading and Result Styles */
.loading {
    text-align: center;
    padding: 20px;
    color: #667eea;
    font-size: 1.1rem;
    font-weight: bold;
}

.loading:before {
    content: '⏳';
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

.result-box {
    padding: 25px;
    border-radius: 18px;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

.result-box.success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border: 2px solid #b8daff;
    box-shadow: 0 10px 30px rgba(21, 87, 36, 0.1);
}

.result-box.error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border: 2px solid #f5c6cb;
    box-shadow: 0 10px 30px rgba(114, 28, 36, 0.1);
}

.gpa-highlight {
    font-size: 2.5rem;
    color: #28a745;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    margin: 10px 0;
}

.semester-breakdown {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    border-left: 5px solid #667eea;
}

.semester-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.semester-item:last-child {
    border-bottom: none;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 20px;
    width: 80%;
    max-width: 500px;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .slogan {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .container {
        padding: 25px;
        margin: 10px;
    }
    
    .course-entry {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .semester-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .semesters-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .calculate-btn, .reset-btn {
        width: 100%;
        min-width: auto;
    }
    
    .header {
        padding: 15px;
        font-size: 14px;
    }
    
    .app-icon {
        width: 25px;
        height: 25px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .slogan {
        font-size: 1.8rem;
    }
    
    .main-icon {
        width: 100px;
        height: 100px;
        font-size: 50px;
    }
    
    .start-btn {
        padding: 15px 35px;
        font-size: 1.1rem;
    }
    
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .semester-section {
        padding: 20px;
    }
    
    .course-entry {
        padding: 12px;
        grid-template-columns: 1fr;
    }
    
    .result-box {
        padding: 20px;
        font-size: 1rem;
    }
    
    .gpa-highlight {
        font-size: 2rem;
    }
    
    .modal-content {
        margin: 20% auto;
        width: 95%;
        padding: 20px;
    }
}

/* Print Styles */
@media print {
    .header,
    .back-btn,
    .add-semester-btn,
    .add-course-btn,
    .remove-course-btn,
    .remove-semester-btn,
    .calculate-btn,
    .reset-btn {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .container {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #ccc;
    }
    
    .result-box {
        background: #f8f9fa !important;
        color: black !important;
        border: 1px solid #ccc !important;
    }
}