/*
 * Login Page Styling - Matching Groups Page Design
 * Uses the same visual language as the groups index page
 */

/* General Body Styling */
body {
    background-color: #f8f9fa;
    font-family: 'Cairo', sans-serif !important;
    color: #495057;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background Pattern with Educational Elements */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        /* Students studying */
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="30" r="8" fill="%23e3f2fd" opacity="0.3"/><circle cx="25" cy="35" r="6" fill="%23e3f2fd" opacity="0.2"/><circle cx="15" cy="40" r="7" fill="%23e3f2fd" opacity="0.25"/></svg>'),
        /* Exam papers */
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect x="70" y="20" width="20" height="25" fill="%23fff3e0" opacity="0.4" rx="2"/><rect x="72" y="22" width="16" height="3" fill="%23ff9800" opacity="0.3"/><rect x="72" y="27" width="12" height="2" fill="%23ff9800" opacity="0.2"/><rect x="72" y="30" width="14" height="2" fill="%23ff9800" opacity="0.2"/></svg>'),
        /* Quiz elements */
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="80" cy="70" r="12" fill="%23f3e5f5" opacity="0.3"/><text x="80" y="75" text-anchor="middle" fill="%239c27b0" opacity="0.4" font-size="14" font-family="Arial">?</text></svg>'),
        /* Attendance check */
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect x="15" y="70" width="18" height="20" fill="%23e8f5e8" opacity="0.3" rx="2"/><circle cx="24" cy="75" r="3" fill="%234caf50" opacity="0.4"/><rect x="20" y="80" width="8" height="2" fill="%234caf50" opacity="0.3"/><rect x="20" y="83" width="8" height="2" fill="%234caf50" opacity="0.3"/></svg>'),
        /* Books and education */
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect x="60" y="80" width="25" height="15" fill="%23e1f5fe" opacity="0.3" rx="1"/><rect x="62" y="82" width="21" height="2" fill="%2303a9f4" opacity="0.3"/><rect x="62" y="85" width="18" height="2" fill="%2303a9f4" opacity="0.2"/><rect x="62" y="88" width="20" height="2" fill="%2303a9f4" opacity="0.2"/></svg>'),
        /* Graduation cap */
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M30 60 L70 60 L70 65 L30 65 Z" fill="%23fce4ec" opacity="0.3"/><path d="M35 60 Q50 50 65 60" fill="none" stroke="%23e91e63" opacity="0.3" stroke-width="2"/><circle cx="50" cy="58" r="2" fill="%23e91e63" opacity="0.4"/></svg>'),
        /* Calculator */
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect x="75" y="15" width="20" height="25" fill="%23f1f8e9" opacity="0.3" rx="2"/><rect x="77" y="17" width="16" height="8" fill="%238bc34a" opacity="0.3"/><rect x="77" y="27" width="6" height="4" fill="%238bc34a" opacity="0.2"/><rect x="85" y="27" width="6" height="4" fill="%238bc34a" opacity="0.2"/><rect x="77" y="32" width="6" height="4" fill="%238bc34a" opacity="0.2"/><rect x="85" y="32" width="6" height="4" fill="%238bc34a" opacity="0.2"/></svg>'),
        /* Pencil */
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M25 85 L35 75 L40 80 L30 90 Z" fill="%23fff8e1" opacity="0.3"/><path d="M35 75 L40 80" stroke="%23ffc107" opacity="0.4" stroke-width="1"/></svg>');
    background-size: 120px 120px, 100px 100px, 80px 80px, 90px 90px, 110px 110px, 100px 100px, 95px 95px, 70px 70px;
    background-position: 
        10% 15%, 85% 25%, 90% 75%, 20% 80%, 70% 85%, 40% 20%, 80% 10%, 15% 60%;
    background-repeat: no-repeat;
    z-index: -1;
    filter: blur(8px);
    opacity: 0.6;
}

/* Additional floating elements */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        /* Floating numbers */
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="10" y="25" fill="%23e3f2fd" opacity="0.2" font-size="16" font-family="Arial">100</text></svg>'),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="85" y="45" fill="%23f3e5f5" opacity="0.15" font-size="14" font-family="Arial">A+</text></svg>'),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="15" y="90" fill="%23e8f5e8" opacity="0.2" font-size="12" font-family="Arial">95%</text></svg>'),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="90" y="90" fill="%23fff3e0" opacity="0.15" font-size="18" font-family="Arial">✓</text></svg>');
    background-size: 80px 80px, 60px 60px, 70px 70px, 50px 50px;
    background-position: 5% 30%, 95% 50%, 10% 95%, 95% 95%;
    background-repeat: no-repeat;
    z-index: -1;
    filter: blur(4px);
    opacity: 0.4;
}

/* Hero Header Section - Matching groups page style */
.bg-primary.bg-gradient {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%) !important;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.bg-primary.bg-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    z-index: -1;
}

.rounded-4 {
    border-radius: 1rem !important;
}

.shadow {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* Logo Styling */
.center-logo {
    max-width: 80px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Card Styling - Matching groups page */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 1rem;
    overflow: hidden;
    backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.95);
    position: relative;
    z-index: 2;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    z-index: -1;
}

.card-header {
    background-color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(233, 236, 239, 0.8);
    backdrop-filter: blur(10px);
}

.card-footer {
    background-color: rgba(248, 249, 250, 0.9);
    border-top: 1px solid rgba(233, 236, 239, 0.8);
    backdrop-filter: blur(10px);
}

/* Badge Styling */
.badge.bg-primary.bg-opacity-10 {
    background-color: rgba(13, 110, 253, 0.1) !important;
    color: #0d6efd !important;
    backdrop-filter: blur(5px);
}

/* Form Styling */
.form-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.form-label .text-danger {
    color: #dc3545 !important;
}

/* Input Group Styling - Matching groups page */
.input-group {
    border: 1px solid rgba(206, 212, 218, 0.8);
    border-radius: 0.375rem;
    background-color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
    overflow: hidden;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    background-color: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

.input-group-text {
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    color: #6c757d;
    padding: 0.75rem 1rem;
    backdrop-filter: blur(5px);
}

.form-control {
    border: none;
    background-color: transparent;
    color: #495057;
    padding: 0.75rem 1rem;
    font-weight: 500;
}

.form-control::placeholder {
    color: #adb5bd;
}

.form-control:focus {
    box-shadow: none;
    background-color: transparent;
    color: #495057;
}

/* Button Styling - Matching groups page */
.btn-primary {
    background-color: #0d6efd;
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: all 0.15s ease-in-out;
    backdrop-filter: blur(5px);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
    background-color: #0a58ca;
    transform: translateY(0);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Form Check Styling */
.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.form-check-label {
    color: #495057;
    font-weight: 500;
}

/* Alert Styling */
.alert {
    border: none;
    border-radius: 0.5rem;
    backdrop-filter: blur(10px);
}

.alert-success {
    background-color: rgba(209, 231, 221, 0.9);
    color: #0f5132;
}

.alert-danger {
    background-color: rgba(248, 215, 218, 0.9);
    color: #721c24;
}

/* Invalid Feedback */
.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Icon Styling */
.fas, .far {
    font-size: 0.875rem;
}

/* Text Utilities */
.text-muted {
    color: #6c757d !important;
}

.text-primary {
    color: #0d6efd !important;
}

.text-danger {
    color: #dc3545 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .card-header {
        padding: 1.5rem;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Reduce background elements on mobile */
    body::before,
    body::after {
        background-size: 60px 60px, 50px 50px, 40px 40px, 45px 45px, 55px 55px, 50px 50px, 47px 47px, 35px 35px;
        filter: blur(12px);
    }
}

/* Animation for page load */
.card {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover effects */
.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.15s ease-in-out;
}

/* Focus states */
.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Button focus state */
.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Floating animation for background elements */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

/* Add subtle movement to background elements */
body::before {
    animation: float 20s ease-in-out infinite;
}

body::after {
    animation: float 25s ease-in-out infinite reverse;
}