/* ============================================
   RielArt Studio - Custom Styles
   ============================================ */

/* CSS Variables */
:root {
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --accent: #06B6D4;
    --accent-hover: #0891B2;
    --dark: #0F172A;
    --gray-body: #475569;
    --gray-light: #F8FAFC;
    --gray-border: #E2E8F0;
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ============================================
   Base Styles & Reset
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Display font for headings */
h1, h2, h3, h4, h5, h6, .font-display {
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    letter-spacing: -0.02em;
}

/* Selection styling */
::selection {
    background-color: var(--primary);
    color: white;
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ============================================
   Navigation Styles
   ============================================ */

#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#navbar.scrolled .nav-link {
    color: var(--dark);
}

.nav-link {
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition-base);
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile menu animation */
#mobile-menu {
    transition: opacity var(--transition-base), transform var(--transition-base);
}

#mobile-menu.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

#mobile-menu:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ============================================
   Hero Section Animations
   ============================================ */

.hero-headline {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s ease-out 0.2s forwards;
}

.hero-subheadline {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s ease-out 0.4s forwards;
}

.hero-ctas {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s ease-out 0.6s forwards;
}

.hero-trust {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s ease-out 0.8s forwards;
}

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

/* ============================================
   Scroll Reveal Animations
   ============================================ */

.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for multiple elements */
.scroll-reveal:nth-child(1) { transition-delay: 0s; }
.scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.2s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.3s; }
.scroll-reveal:nth-child(5) { transition-delay: 0.4s; }
.scroll-reveal:nth-child(6) { transition-delay: 0.5s; }
.scroll-reveal:nth-child(7) { transition-delay: 0.6s; }
.scroll-reveal:nth-child(8) { transition-delay: 0.7s; }

/* ============================================
   Service Cards
   ============================================ */

.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
}

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

/* ============================================
   Process Section Timeline
   ============================================ */

.process-step {
    position: relative;
}

/* Mobile timeline line */
@media (max-width: 1023px) {
    .process-step::before {
        content: '';
        position: absolute;
        top: 32px;
        left: 32px;
        width: 2px;
        height: calc(100% + 2rem);
        background: linear-gradient(to bottom, var(--primary), var(--accent));
        z-index: 0;
    }
    
    .process-step:last-child::before {
        display: none;
    }
}

/* ============================================
   FAQ Accordion
   ============================================ */

.faq-item {
    transition: box-shadow var(--transition-base);
}

.faq-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.faq-trigger {
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.faq-icon {
    transition: transform var(--transition-base);
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base), padding var(--transition-base);
}

.faq-item.active .faq-content {
    max-height: 500px;
}

/* Smooth expand/collapse */
.faq-content:not(.hidden) {
    animation: slideDown 0.3s ease-out;
}

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

/* ============================================
   Featured Project Card
   ============================================ */

.featured-project {
    position: relative;
    overflow: hidden;
}

.featured-project::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(249, 115, 22, 0.1));
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.featured-project:hover::after {
    opacity: 1;
}

/* ============================================
   Form Styles
   ============================================ */

input, textarea, select {
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus, textarea:focus, select:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Custom select arrow */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

/* ============================================
   Button Hover Effects
   ============================================ */

button, a {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

button:hover, a:hover {
    transform: scale(1.02);
}

button:active, a:active {
    transform: scale(0.98);
}

/* Remove scale from nav links */
.nav-link:hover, .mobile-nav-link:hover {
    transform: none;
}

/* ============================================
   Modal Styles
   ============================================ */

#success-modal {
    transition: opacity var(--transition-base);
}

#success-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

#success-modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

#success-modal > div {
    animation: modalPop 0.3s ease-out;
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   Footer Social Icons
   ============================================ */

footer a[aria-label] {
    transition: all var(--transition-base);
}

footer a[aria-label]:hover {
    transform: translateY(-3px);
}

/* ============================================
   Utility Classes
   ============================================ */

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass effect */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Subtle shadow */
.shadow-subtle {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Hover lift effect */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

/* ============================================
   Responsive Adjustments
   ============================================ */

/* Tablet adjustments */
@media (max-width: 1023px) {
    .hero-headline {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .process-step::before {
        left: 24px;
    }
}

/* Mobile adjustments */
@media (max-width: 639px) {
    .hero-headline {
        font-size: 2rem;
        line-height: 1.25;
    }
    
    .hero-subheadline {
        font-size: 1rem;
    }
    
    .service-card,
    .faq-item {
        padding: 1.5rem;
    }
    
    .featured-project {
        border-radius: 1.5rem;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .scroll-reveal {
        opacity: 1;
        transform: none;
    }
    
    .hero-headline,
    .hero-subheadline,
    .hero-ctas,
    .hero-trust {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   Hero Metrics Animations
   ============================================ */

.hero-metrics {
    position: relative;
    z-index: 10;
}

.hero-metrics img {
    transition: transform 0.3s ease;
}

.hero-metrics:hover img {
    transform: scale(1.02);
}

/* Floating animation for stat cards */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float 6s ease-in-out 2s infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(1deg);
    }
}

/* Counter pulse animation */
.animate-counter-pulse {
    animation: counterPulse 2s ease-in-out infinite;
}

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

/* Glow effect for metric cards */
.hero-metrics::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    #navbar,
    #mobile-menu,
    .hero-ctas,
    #contact-form button,
    footer a[aria-label] {
        display: none !important;
    }
    
    body {
        color: black;
        background: white;
    }
    
    section {
        page-break-inside: avoid;
    }
}

/* ============================================
   Loading State
   ============================================ */

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   Custom Scrollbar
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-light);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-body);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--gray-border) var(--gray-light);
}
