/* EscalaNota - Custom Styles */

/* CSS Variables for Color Palette */
:root {
    --primary-dark: #1A1A2E;
    --secondary-dark: #16213E;
    --tertiary-dark: #0F3460;
    --accent-color: #E94560;
    --white-color: #FFFFFF;
    --light-gray: #F8F9FA;
    --medium-gray: #6C757D;
    --success-color: #28A745;
    --warning-color: #FFC107;
    --info-color: #17A2B8;
    --danger-color: #DC3545;
    
    /* Gradient Variables */
    --primary-gradient: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 50%, var(--tertiary-dark) 100%);
    --accent-gradient: linear-gradient(135deg, var(--accent-color) 0%, #FF6B8A 100%);
    --success-gradient: linear-gradient(135deg, var(--success-color) 0%, #34CE57 100%);
    --info-gradient: linear-gradient(135deg, var(--info-color) 0%, #20C997 100%);
    
    /* Shadow Variables */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    
    /* Border Radius */
    --border-radius: 0.75rem;
    --border-radius-lg: 1rem;
    
    /* Transitions */
    --transition-fast: all 0.2s ease-in-out;
    --transition-normal: all 0.3s ease-in-out;
    --transition-slow: all 0.5s ease-in-out;
}

/* Global Styles */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--primary-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.025em;
}

.display-4 {
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Header Styles */
.header-gradient {
    background: var(--primary-gradient);
    position: relative;
    overflow: hidden;
}

.header-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.header-gradient .container {
    position: relative;
    z-index: 1;
}

/* Main Content */
.main-content {
    flex: 1;
    background: transparent;
}

/* Custom Cards */
.custom-card {
    border: none;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    transition: var(--transition-normal);
}

.custom-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.custom-card .card-header {
    background: var(--primary-gradient) !important;
    border: none;
    padding: 1.25rem;
    position: relative;
}

.custom-card .card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Form Styles */
.custom-input,
.custom-select {
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
}

.custom-input:focus,
.custom-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(233, 69, 96, 0.25);
    transform: translateY(-2px);
}

.custom-input.is-invalid,
.custom-select.is-invalid {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.custom-input.is-valid,
.custom-select.is-valid {
    border-color: var(--success-color);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Custom Buttons */
.custom-btn {
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.custom-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: var(--transition-normal);
}

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

.custom-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(233, 69, 96, 0.3);
}

.custom-btn:active {
    transform: translateY(-1px);
}

.custom-btn-outline {
    background: transparent;
    border: 2px solid var(--medium-gray);
    color: var(--medium-gray);
    border-radius: var(--border-radius);
    padding: 0.75rem 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition-fast);
}

.custom-btn-outline:hover {
    background: var(--medium-gray);
    color: var(--white-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.3);
}

/* Result Card Styles */
.result-card {
    animation: slideInUp 0.5s ease-out;
}

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

.conversion-result {
    padding: 1rem;
}

.original-grade,
.converted-grade {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 0.5rem 0;
}

.original-grade {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #2196f3;
}

.converted-grade {
    background: var(--success-gradient);
    color: var(--white-color);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.conversion-arrow {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border-left: 4px solid var(--info-color);
}

/* Table Styles */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:hover {
    background: rgba(233, 69, 96, 0.05);
    transform: scale(1.01);
    transition: var(--transition-fast);
}

.table thead th {
    background: var(--primary-gradient);
    color: var(--white-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    padding: 1rem;
}

.table tbody td {
    padding: 0.75rem 1rem;
    border-color: rgba(0, 0, 0, 0.05);
    vertical-align: middle;
}

/* Badge Styles */
.badge {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    font-weight: 600;
}

/* Footer Styles */
.footer-gradient {
    background: var(--primary-gradient);
    margin-top: auto;
    position: relative;
}

.footer-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
}

.footer-gradient a {
    color: var(--white-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-gradient a:hover {
    color: #ffc107;
    text-decoration: underline;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .custom-card .card-body {
        padding: 1.5rem;
    }
    
    .custom-btn,
    .custom-btn-outline {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .conversion-result {
        padding: 0.5rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }
    
    .custom-input,
    .custom-select {
        font-size: 1rem;
    }
    
    .header-gradient {
        padding: 2rem 0;
    }
    
    .main-content {
        padding: 2rem 0;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-gray: #2d3748;
        --medium-gray: #a0aec0;
    }
    
    body {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        color: var(--white-color);
    }
    
    .custom-card {
        background: rgba(45, 55, 72, 0.95);
        color: var(--white-color);
    }
    
    .custom-input,
    .custom-select {
        background: rgba(255, 255, 255, 0.1);
        color: var(--white-color);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .custom-input::placeholder {
        color: rgba(255, 255, 255, 0.6);
    }
    
    .table {
        background: rgba(45, 55, 72, 0.8);
        color: var(--white-color);
    }
    
    .table tbody td {
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators for better accessibility */
.custom-input:focus,
.custom-select:focus,
.custom-btn:focus,
.custom-btn-outline:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .custom-card {
        border: 2px solid currentColor;
    }
    
    .custom-btn {
        border: 2px solid currentColor;
    }
    
    .table {
        border: 2px solid currentColor;
    }
}

/* Print styles */
@media print {
    .header-gradient,
    .footer-gradient,
    .custom-btn,
    .custom-btn-outline {
        display: none;
    }
    
    .custom-card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    body {
        background: white;
        color: black;
    }
}
