/**
 * Custom CSS Styles
 * Rukaya's Professional Portfolio
 */

/* ===================================
   CSS Custom Properties (Variables)
   =================================== */
:root {
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --accent: #22D3EE;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --gradient-accent: linear-gradient(135deg, #22D3EE 0%, #06b6d4 100%);
}

/* ===================================
   Global Styles
   =================================== */
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.dark ::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #6366f1, #4f46e5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #4f46e5, #4338ca);
}

/* Selection Color */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: inherit;
}

/* ===================================
   Typography Enhancements
   =================================== */
.gradient-text {
    background: linear-gradient(135deg, #6366f1 0%, #22D3EE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.font-serif {
    font-family: 'Playfair Display', serif;
}

/* ===================================
   Navigation Styles
   =================================== */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, #22D3EE);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ===================================
   Button Styles
   =================================== */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

.btn-outline {
    background: transparent;
    border: 2px solid #e2e8f0;
    color: #475569;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    border-color: #6366f1;
    color: #6366f1;
    transform: translateY(-2px);
}

/* ===================================
   Card Styles
   =================================== */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.dark .card-hover:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Glassmorphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===================================
   Progress Bar Animation
   =================================== */
.progress-bar {
    position: relative;
    height: 0.75rem;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}

.dark .progress-bar {
    background: #374151;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #6366f1, #22D3EE);
    transition: width 1.5s ease-out;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ===================================
   Timeline Styles
   =================================== */
.timeline-item {
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -33px;
    top: 24px;
    width: 2px;
    height: calc(100% + 32px);
    background: linear-gradient(180deg, #6366f1, transparent);
}

.timeline-item:last-child::before {
    display: none;
}

/* ===================================
   Form Styles
   =================================== */
.form-input {
    transition: all 0.3s ease;
}

.form-input:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* ===================================
   Animation Classes
   =================================== */
.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out forwards;
}

.animate-slide-down {
    animation: slideDown 0.3s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Pulse Glow Animation */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(99, 102, 241, 0.5);
    }
}

.animate-pulse-glow {
    animation: pulseGlow 3s ease-in-out infinite;
}

/* ===================================
   Loader Styles
   =================================== */
.loader {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-radius: 50%;
    border-top-color: #6366f1;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===================================
   Page Loader
   =================================== */
.page-loader {
    position: fixed;
    inset: 0;
    background: white;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.dark .page-loader {
    background: #0f172a;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.page-loader .loader-content {
    text-align: center;
}

.page-loader .loader-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #6366f1, #22D3EE);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    animation: pulseGlow 2s ease-in-out infinite;
}

.page-loader .loader-logo span {
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
}

/* ===================================
   Tooltip Styles
   =================================== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    padding: 0.5rem 1rem;
    background: #1e293b;
    color: white;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 50;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

/* ===================================
   Image Styles
   =================================== */
.img-cover {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.img-zoom {
    transition: transform 0.5s ease;
}

.img-zoom:hover {
    transform: scale(1.1);
}

/* ===================================
   Section Decorations
   =================================== */
.section-divider {
    position: relative;
    overflow: hidden;
}

.section-divider::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(transparent, white);
}

.dark .section-divider::after {
    background: linear-gradient(transparent, #111827);
}

/* ===================================
   Responsive Utilities
   =================================== */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* ===================================
   Print Styles
   =================================== */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    a {
        text-decoration: underline;
    }
}

/* ===================================
   Accessibility
   =================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    padding: 1rem;
    background: #6366f1;
    color: white;
    z-index: 9999;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}
