/**
 * TSO Theme - Custom Styles
 * Additional styles and refinements
 */

/* ============================================
   ENHANCED ANIMATIONS
   ============================================ */

/* Loading state */
body:not(.is-loaded) .hero-content {
    opacity: 0;
}

body.is-loaded .hero-content {
    animation: fadeInUp 1s var(--ease-out-expo) forwards;
}

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

/* Menu toggle animation */
.menu-toggle.is-open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.is-open span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Body lock when menu is open */
body.menu-open {
    overflow: hidden;
}

/* ============================================
   FORM MESSAGE STYLES
   ============================================ */
.form-message {
    margin-top: 16px;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: center;
}

.form-message--success {
    background-color: rgba(52, 199, 89, 0.1);
    color: #248a3d;
    border: 1px solid rgba(52, 199, 89, 0.2);
}

.form-message--error {
    background-color: rgba(255, 59, 48, 0.1);
    color: #d70015;
    border: 1px solid rgba(255, 59, 48, 0.2);
}

/* ============================================
   GRADIENT TEXT EFFECT
   ============================================ */
.gradient-text {
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-gray-dark) 50%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   GLASSMORPHISM CARDS
   ============================================ */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* ============================================
   ENHANCED SERVICE CARDS
   ============================================ */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    opacity: 0;
    transition: opacity var(--duration-medium);
}

.service-card:hover::before {
    opacity: 1;
}

/* ============================================
   CURSOR GLOW EFFECT (OPTIONAL)
   ============================================ */
@media (hover: hover) and (pointer: fine) {
    .hero {
        position: relative;
    }
    
    .hero::after {
        content: '';
        position: absolute;
        width: 600px;
        height: 600px;
        background: radial-gradient(circle, rgba(0, 113, 227, 0.06) 0%, transparent 70%);
        pointer-events: none;
        transform: translate(-50%, -50%);
        opacity: 0;
        transition: opacity 0.3s;
    }
}

/* ============================================
   SELECTION STYLES
   ============================================ */
::selection {
    background-color: var(--color-accent);
    color: var(--color-pure-white);
}

::-moz-selection {
    background-color: var(--color-accent);
    color: var(--color-pure-white);
}

/* ============================================
   FOCUS STYLES FOR ACCESSIBILITY
   ============================================ */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================
   SKIP LINK FOR ACCESSIBILITY
   ============================================ */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 24px;
    background: var(--color-dark);
    color: var(--color-white);
    border-radius: 8px;
    z-index: 9999;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 16px;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .site-header,
    .hero-scroll,
    .nav-cta,
    .btn,
    .contact-form-wrapper {
        display: none !important;
    }
    
    .section {
        padding: 40px 0;
    }
    
    body {
        font-size: 12pt;
        color: black;
    }
    
    h1, h2, h3, h4 {
        page-break-after: avoid;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* ============================================
   DARK MODE SUPPORT (OPTIONAL)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable automatic dark mode
    :root {
        --color-black: #ffffff;
        --color-dark: #f5f5f7;
        --color-gray-dark: #a1a1a6;
        --color-gray: #6e6e73;
        --color-gray-light: #3d3d3f;
        --color-off-white: #1d1d1f;
        --color-white: #0a0a0a;
        --color-pure-white: #000000;
    }
    */
}

/* ============================================
   LOADING ANIMATION FOR FORM
   ============================================ */
.form-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.form-submit.is-loading {
    position: relative;
    color: transparent;
}

.form-submit.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: var(--color-pure-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   TOOLTIP STYLES
   ============================================ */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-pure-white);
    background: var(--color-dark);
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s var(--ease-out-quart);
    pointer-events: none;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

