/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #f4f7fa;
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-25px); }
    60% { transform: translateY(-12px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes gradientShift {
    0% { background: linear-gradient(135deg, #2c7a7b 0%, #1e3a8a 100%); }
    50% { background: linear-gradient(135deg, #1e3a8a 0%, #2c7a7b 100%); }
    100% { background: linear-gradient(135deg, #2c7a7b 0%, #1e3a8a 100%); }
}

.animate-fade-in {
    animation: fadeIn 1s ease-out forwards;
}

.animate-slide-in {
    animation: slideIn 0.6s ease-out forwards;
}

.animate-bounce {
    animation: bounce 1.2s ease-in-out;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* Modern Page Styles */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2c7a7b 0%, #1e3a8a 100%);
    position: relative;
    overflow: hidden;
    animation: gradientShift 15s ease infinite;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"%3E%3Cpath fill="rgba(255,255,255,0.05)" fill-opacity="1" d="M0,224L48,213.3C96,203,192,181,288,186.7C384,192,480,224,576,224C672,224,768,192,864,181.3C960,171,1056,181,1152,197.3C1248,213,1344,235,1392,245.3L1440,256L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"%3E%3C/path%3E%3C/svg%3E') no-repeat bottom;
    z-index: 1;
}

.auth-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 450px;
    padding: 1.5rem;
}

.auth-container.dashboard-container {
    max-width: 100%;
    padding: 2rem;
}

.auth-card {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px);
    opacity: 0;
}

.auth-card header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card .logo {
    display: block;
    margin: 0 auto 1.5rem;
    max-width: 90px;
    height: auto;
    transition: transform 0.3s ease;
}

.auth-card .logo:hover {
    transform: scale(1.1);
}

.auth-card h2 {
    text-align: center;
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-card .subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.auth-card .error {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
}

.auth-form {
    width: 100%;
    box-sizing: border-box;
}

.form-group {
    margin-bottom: 1.5rem;
    opacity: 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    color: #2d3748;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.form-group input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 0.9rem 1.2rem;
    color: #2d3748;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.form-group input:hover {
    border-color: #1e3a8a;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.1);
}

.form-group input::placeholder {
    color: #a0a0a0;
}

.form-group input:focus {
    outline: none;
    border-color: #1e3a8a;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.15);
}

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper .toggle-password {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 1.3rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.password-wrapper .toggle-password:hover {
    color: #1e3a8a;
}

.auth-btn {
    width: 100%;
    background: linear-gradient(90deg, #1e3a8a 0%, #2c7a7b 100%);
    color: #ffffff;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.6s ease-out forwards;
    text-decoration: none;
    display: block;
    text-align: center;
}

.auth-btn:hover {
    background: linear-gradient(90deg, #2c7a7b 0%, #1e3a8a 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.auth-btn.loading {
    filter: blur(2px);
    cursor: not-allowed;
}

.auth-btn .loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.auth-btn.loading .loader {
    display: block;
}

/* Dashboard Specific Styles */
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    opacity: 0;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}

.card-icon {
    display: block;
    margin: 0 auto 10px;
    width: 32px;
    height: 32px;
    fill: #4a90e2;
}

.dashboard-card h3 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.profile-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.profile-details p, .notices p, .homework p, .fee-details p {
    margin: 0.5rem 0;
    color: #2d3748;
    font-size: 0.95rem;
}

.notice-item, .homework-item, .receipt-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem 0;
}

.notice-item:last-child, .homework-item:last-child, .receipt-item:last-child {
    border-bottom: none;
}

.calendar {
    margin: 1rem 0;
}

.calendar h4 {
    color: #2d3748;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.calendar table {
    width: 100%;
    border-collapse: collapse;
}

.calendar th, .calendar td {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid #e0e0e0;
    font-size: 0.9rem;
}

.calendar th {
    background: rgba(0, 0, 0, 0.05);
    color: #2d3748;
}

.present {
    background-color: rgba(22, 163, 74, 0.2);
}

.absent {
    background-color: rgba(220, 38, 38, 0.2);
}

.logout-btn {
    width: auto;
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Responsive Design */
@media (min-width: 768px) {
    .auth-container.dashboard-container {
        max-width: 90%;
    }

    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .auth-container.dashboard-container {
        max-width: 1200px;
    }

    .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .auth-container {
        max-width: 100%;
        padding: 0.5rem;
    }

    .auth-container.dashboard-container {
        max-width: 100%;
        padding: 0.5rem;
    }

    .auth-card {
        padding: 1.5rem;
        border-radius: 15px;
    }

    .auth-card h2 {
        font-size: 1.5rem;
    }

    .auth-card .subtitle {
        font-size: 1rem;
    }

    .auth-btn {
        font-size: 1rem;
        padding: 0.85rem;
    }

    .card-grid {
        gap: 1rem;
    }

    .dashboard-card {
        padding: 1.2rem;
    }

    .dashboard-card h3 {
        font-size: 1.2rem;
    }

    .dashboard-card p {
        font-size: 0.9rem;
    }
}