/**
 * UOJ Verification Portal - Consistent CSS Framework
 * Provides consistent styling and design system
 */

/* CSS Variables for consistent theming */
:root {
    --primary-color: #00d4ff;
    --primary-dark: #0099cc;
    --primary-light: #33ddff;
    --secondary-color: #6c757d;
    --success-color: #00ff88;
    --danger-color: #ff4757;
    --warning-color: #ffa502;
    --info-color: #3742fa;
    --light-color: #f8f9fa;
    --dark-color: #0a0a0a;
    --dark-secondary: #1a1a1a;
    --dark-tertiary: #2a2a2a;
    
    --font-family-primary: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-family-secondary: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    
    --border-radius: 12px;
    --border-radius-lg: 24px;
    --box-shadow: 0 8px 32px rgba(0, 212, 255, 0.2);
    --box-shadow-hover: 0 12px 48px rgba(0, 212, 255, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base styles */
html, body {
    height: 100%;
    margin: 0;
    font-family: var(--font-family-primary);
    overflow-x: hidden;
}

body {
    background: linear-gradient(135deg, var(--dark-color), var(--dark-secondary));
    color: white;
}

/* Particle background */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--dark-color), var(--dark-secondary));
    z-index: -1;
}

/* Glass morphism effect */
.bg-glass {
    background: rgba(26, 26, 26, 0.85);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden;
}

.bg-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.6;
}

/* Button styles */
.btn-glow {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--dark-color);
    font-weight: 700;
    border: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    padding: 1rem 2rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-glow::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-glow:hover::before {
    left: 100%;
}

.btn-glow:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    box-shadow: var(--box-shadow-hover);
    color: var(--dark-color);
    transform: translateY(-2px);
}

.btn-glow:active {
    transform: translateY(0);
}

.btn-info {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: none;
    color: var(--dark-color);
    font-weight: 700;
}

.btn-info:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: var(--dark-color);
}

.btn-outline-glow {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-outline-glow:hover {
    background-color: var(--primary-color);
    color: var(--dark-color);
    box-shadow: 0 0 20px var(--primary-color);
}

/* Form styles */
.form-outline .form-control {
    background-color: rgba(42, 42, 42, 0.8);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: var(--border-radius);
    color: white;
    transition: var(--transition);
    padding: 1rem 1.25rem;
    font-size: 1rem;
    backdrop-filter: blur(10px);
}

.form-outline .form-control:focus {
    background-color: rgba(42, 42, 42, 0.9);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 212, 255, 0.25);
    color: white;
    outline: none;
}

.form-outline .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-outline .form-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.form-outline .form-control:focus ~ .form-label,
.form-outline .form-control:not(:placeholder-shown) ~ .form-label {
    color: var(--primary-color);
    transform: translateY(-1.5rem) scale(0.85);
}

.form-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Card styles */
.card {
    border: none;
    border-radius: var(--border-radius-lg);
    transition: var(--transition);
    background: transparent;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-hover);
}

.card-title {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
}

.card-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.card-body {
    padding: 2rem;
}

/* Alert styles */
.alert {
    border: none;
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    border-left: 4px solid;
}

.alert-success {
    background-color: rgba(0, 255, 136, 0.15);
    border-left-color: var(--success-color);
    color: #b8f5d1;
}

.alert-danger {
    background-color: rgba(255, 71, 87, 0.15);
    border-left-color: var(--danger-color);
    color: #ffb3ba;
}

.alert-warning {
    background-color: rgba(255, 165, 2, 0.15);
    border-left-color: var(--warning-color);
    color: #ffe0b3;
}

.alert-info {
    background-color: rgba(0, 212, 255, 0.15);
    border-left-color: var(--primary-color);
    color: #b3f0ff;
}

/* Material Icons */
.material-icons {
    vertical-align: middle;
    margin-right: 0.5rem;
}

/* Text colors */
.text-info {
    color: var(--primary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

/* Spacing utilities */
.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1.5rem;
    }
    
    .btn-glow {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
}

/* Verification card specific styles */
.verification-details {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1rem 0;
}

.verification-details p {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.verification-details strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Print styles */
@media print {
    #particles-js, .btn, form, .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
        font-family: Arial, sans-serif !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        background: white !important;
    }
    
    .print-header {
        text-align: center;
        margin-bottom: 20px;
        border-bottom: 2px solid #333;
        padding-bottom: 15px;
    }
    
    .verification-details {
        background: white !important;
        border: 1px solid #ddd;
    }
    
    .verification-details strong {
        color: #333 !important;
    }
}

/* Loading spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.1em;
}

.spinner-border-lg {
    width: 5rem;
    height: 5rem;
    border-width: 0.5em;
}

/* Material Icons */
.material-icons {
    vertical-align: middle;
    margin-right: 5px;
}

/* Page header */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.page-header .lead {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Breadcrumb */
.breadcrumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb-item a:hover {
    color: var(--primary-dark);
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

/* Responsive design */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }
    
    .card {
        margin: 10px;
        padding: 1rem;
    }
    
    .verification-details .row {
        flex-direction: column;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-group .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .card {
        margin: 5px;
        padding: 0.75rem;
    }
    
    .verification-details {
        padding: 1rem;
    }
    
    .verification-details p {
        font-size: 1rem;
    }
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Utility classes */
.text-glow {
    text-shadow: 0 0 10px var(--primary-color);
}

.border-glow {
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.shadow-glow {
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

/* Focus styles for accessibility */
.btn:focus,
.form-control:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #00ffff;
        --dark-color: #000000;
        --light-color: #ffffff;
    }
    
    .bg-glass {
        background: rgba(0, 0, 0, 0.8);
        border: 2px solid white;
    }
    
    .form-control {
        background: white;
        color: black;
        border: 2px solid black;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    #particles-js {
        display: none;
    }
}
