/* Enhanced Custom Styles for DAR Misamis Occidental */

/* Modern CSS Variables */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #10b981;
    --accent-color: #8b5cf6;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced Loading Animation */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--glass-border);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Advanced Card Animations */
.card-hover-effect {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.card-hover-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.card-hover-effect:hover::before {
    left: 100%;
}

.card-hover-effect:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-heavy);
}

/* Modern Button Styles */
.btn-modern {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 12px;
    transition: var(--transition);
    overflow: hidden;
    text-decoration: none;
    cursor: pointer;
    border: none;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-modern:hover::before {
    left: 100%;
}

.btn-primary-modern {
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    color: white;
    box-shadow: var(--shadow-light);
}

.btn-primary-modern:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

.btn-secondary-modern {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--dark-color);
}

.btn-secondary-modern:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

/* Enhanced Navigation Styles */
.nav-item {
    position: relative;
    padding: 8px 16px;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-item:hover::after,
.nav-item.active::after {
    width: 80%;
}

/* Advanced Dropdown Styles */
.dropdown-modern {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: var(--transition);
    z-index: 1000;
}

.dropdown-modern.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    padding-left: 20px;
}

/* Modern Form Styles */
.form-modern {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 32px;
    box-shadow: var(--shadow-light);
}

.input-modern {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--glass-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    transition: var(--transition);
    font-size: 16px;
}

.input-modern:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Animated Icons */
.icon-bounce {
    display: inline-block;
    animation: bounce-gentle 2s infinite;
}

@keyframes bounce-gentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.icon-rotate {
    display: inline-block;
    transition: transform 0.3s ease;
}

.icon-rotate:hover {
    transform: rotate(15deg);
}

/* Progress Indicators */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--glass-bg);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

/* Modern Alerts */
.alert-modern {
    padding: 16px 20px;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-light);
    position: relative;
    overflow: hidden;
}

.alert-success {
    border-left-color: var(--secondary-color);
    background: rgba(16, 185, 129, 0.1);
}

.alert-warning {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.alert-error {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .btn-modern {
        width: 100%;
        margin-bottom: 12px;
    }
    
    .dropdown-modern {
        position: static;
        width: 100%;
        margin-top: 8px;
        transform: none;
    }
    
    .form-modern {
        padding: 20px;
        margin: 16px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #1e293b;
        --dark-color: #f8fafc;
        --glass-bg: rgba(0, 0, 0, 0.3);
        --glass-border: rgba(255, 255, 255, 0.1);
    }
    
    .card-hover-effect {
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.3));
    }
    
    .input-modern {
        background: rgba(0, 0, 0, 0.3);
        color: white;
    }
}

/* Performance optimizations */
* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
.focus-ring {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    transition: top 0.3s;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}