/* assets/css/base.css - Base Styles & Variables (FIXED - Problematic rules removed) */

/* CSS Custom Properties */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-color: #667eea;
    --text-muted: #6c757d;
    --border-radius-lg: 1rem;
    --box-shadow-soft: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --bg-light-section: #f8f9fa;
}

[data-bs-theme="dark"] {
    --primary-gradient: linear-gradient(135deg, #4c63d2 0%, #5a4fcf 100%);
    --secondary-gradient: linear-gradient(135deg, #d084e8 0%, #e74c6c 100%);
    --accent-color: #6366f1;
    --text-muted: #9ca3af;
    --box-shadow-soft: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.3);
    --bg-light-section: #1f2937;
}

/* FIXED: Simplified anti-flickering - removed problematic visibility rules */
.preload,
.preload * {
    transition: none !important;
    animation-duration: 0s !important;
    animation-delay: 0s !important;
}

/* REMOVED: Problematic visibility rules that caused white screen
body:not(.loaded) {
    visibility: hidden;
}
body.loaded {
    visibility: visible;
}
*/

/* Ensure immediate theme application */
html {
    transition: background-color 0.3s ease, color 0.3s ease;
}

html[data-bs-theme="dark"] {
    background-color: #111827;
    color: #f9fafb;
}

html[data-bs-theme="light"] {
    background-color: #ffffff;
    color: #111827;
}

/* Smooth transitions for theme changes */
body,
.card-custom,
.navbar-custom,
.footer-custom,
.form-control,
.form-floating > label,
.contact-info-card,
.contact-info-icon,
.contact-icon-accent,
.accordion-item,
.accordion-button {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Prevent FOUC on page load - disable transitions initially */
.preload,
.preload * {
    transition: none !important;
}

/* Base Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Main Content */
.main-content {
    padding-top: 80px;
    margin: 0;
    position: relative;
}

/* Buttons */
.btn-gradient {
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-soft);
    color: white;
}

.btn-gradient::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-smooth);
}

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

/* Cards */
.card-custom {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-soft);
    transition: var(--transition-smooth);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: relative;
}

[data-bs-theme="dark"] .card-custom {
    background: rgba(17, 24, 39, 0.9);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.card-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: var(--transition-smooth);
}

.card-custom:hover::before {
    transform: scaleX(1);
}

.card-custom:hover {
    transform: translateY(-10px);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.2);
}

.card-custom .card-header {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 1.5rem;
    font-weight: 600;
}

/* Forms */
.form-floating > .form-control {
    border-radius: 0.5rem;
    border: 2px solid rgba(102, 126, 234, 0.1);
    transition: var(--transition-smooth);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

[data-bs-theme="dark"] .form-floating > .form-control {
    background: rgba(31, 41, 55, 0.8);
    border-color: rgba(75, 85, 99, 0.3);
}

.form-floating > .form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
    background: white;
}

[data-bs-theme="dark"] .form-floating > .form-control:focus {
    background: var(--bs-dark);
}

.form-floating > label {
    color: var(--text-muted);
}

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

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

/* Alert Styles */
.alert-custom {
    border-radius: var(--border-radius-lg);
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #059669;
    border-left: 4px solid #10b981;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border-left: 4px solid #3b82f6;
}

/* Badges */
.badge-custom {
    background: var(--primary-gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Hero Image Placeholder - Enhanced */
.hero-image-placeholder {
    width: 300px;
    height: 300px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: pulse 2s infinite;
    margin: 0 auto;
    box-shadow: var(--box-shadow-soft);
    position: relative;
    overflow: hidden;
}

/* Add subtle glow effect to hero image */
.hero-image-placeholder::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--primary-gradient);
    border-radius: 50%;
    z-index: -1;
    filter: blur(8px);
    opacity: 0.3;
}

.hero-image-placeholder i {
    font-size: 4rem;
    position: relative;
    z-index: 1;
}

/* Hero content spacing */
.hero-content {
    position: relative;
    z-index: 2;
    padding: 1rem 0;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    min-height: 1.2em;
    display: block;
    text-align: left;
}

.hero-content .lead {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Ensure hero container has proper structure */
.hero-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    position: relative;
}

/* Typewriter Animation Styles */
.typewriter-text {
    display: inline-block;
    min-height: 1.2em;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.typewriter-cursor {
    display: inline-block;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: blink 1s infinite;
    font-weight: normal;
    margin-left: 2px;
}

/* Inline cursor that stays with the text */
.typewriter-cursor-inline {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: blink 1s infinite;
    font-weight: normal;
    display: inline;
}

[data-bs-theme="dark"] .typewriter-text,
[data-bs-theme="dark"] .typewriter-cursor,
[data-bs-theme="dark"] .typewriter-cursor-inline {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Mobile responsive adjustments for typewriter */
@media (max-width: 768px) {
    .hero-content h1 {
        text-align: center;
    }
    
    .typewriter-text {
        line-height: 1.2;
    }
}

@media (max-width: 576px) {
    .typewriter-text {
        min-height: 1.1em;
        line-height: 1.1;
    }
    
    .hero-content h1 {
        line-height: 1.1;
        min-height: 1.1em;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out;
}

/* Screen reader only class */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Lazy loading images */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

img.lazy.loaded {
    opacity: 1;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .typewriter-cursor,
    .typewriter-cursor-inline {
        animation: none;
        opacity: 1;
    }

    .preload,
    .preload * {
        transition: none !important;
        animation: none !important;
    }

    * {
        transition: none !important;
        animation: none !important;
    }

    /* Disable all transforms and animations */
    .hero-image-placeholder {
        animation: none;
    }

    .card-custom:hover {
        transform: none;
    }

    .btn-gradient:hover {
        transform: none;
    }

    .gallery-item:hover {
        transform: none;
    }
}

/* ============================================================================ */
/* Inline styles extracted for CSP compliance                                  */
/* ============================================================================ */

/* Navigation - Lock icon */
.nav-link .fa-lock {
    font-size: 0.75em;
}

/* Toast containers */
.toast-container.logout-toast {
    z-index: 1055;
    margin-top: 80px;
}

/* Cookie consent banner icon */
.cookie-consent-banner .fa-cookie-bite {
    font-size: 2rem;
}

/* Modal icons - large */
.modal-icon-large {
    font-size: 3rem;
}
