/* ============================================
   BrickPilot - Construction Site Manager
   Custom Styles (Tailwind CSS companion)
   Theme extracted from Flutter app source
   ============================================ */

:root {
    --color-primary: #5CA9FF;
    --color-primary-dark: #2F6BFF;
    --color-accent: #FFD93D;
    --color-success: #2ED47A;
    --color-error: #FF4D4F;
    --color-warning: #FF8A3D;
    --color-bg-primary: #081B3A;
    --color-bg-secondary: #050F24;
    --color-bg-card: #06162E;
    --color-bg-light: #EAF2FF;
    --color-text-primary: #FFFFFF;
    --color-text-secondary: #C7D2E4;
    --color-text-tertiary: #8FA1C2;
    --color-text-dark: #0F1E3A;
    --color-gray: #5F6F8F;
    --btn-gradient: linear-gradient(to bottom, #2F6BFF 6.5%, #5CA9FF 89%);
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius-sm: 9px;
    --radius-md: 15px;
    --radius-lg: 28px;
    --radius-full: 999px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
}

/* ---- Navigation ---- */
.nav-link {
    position: relative;
    transition: color 0.2s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.25s ease;
}
.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}
.mobile-menu.open {
    max-height: 320px;
}

/* ---- Buttons ---- */
.btn-primary {
    background: var(--btn-gradient);
    color: #fff;
    border-radius: var(--radius-full);
    padding: 14px 32px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 16px -4px rgba(47, 107, 255, 0.35);
    text-decoration: none;
    border: none;
    cursor: pointer;
    line-height: 1.2;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -4px rgba(47, 107, 255, 0.45);
}

.btn-secondary {
    background: var(--color-accent);
    color: var(--color-text-dark);
    border-radius: var(--radius-full);
    padding: 14px 32px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 16px -4px rgba(255, 217, 61, 0.3);
    text-decoration: none;
    border: none;
    cursor: pointer;
    line-height: 1.2;
}
.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -4px rgba(255, 217, 61, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-full);
    padding: 12px 30px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.2;
}
.btn-outline:hover {
    background: rgba(92, 169, 255, 0.1);
    transform: translateY(-1px);
}

/* ---- Device Mockup ---- */
.device-frame {
    position: relative;
    display: inline-block;
    background: linear-gradient(160deg, #1C2B4F, #0a1530);
    border-radius: 36px;
    padding: 10px;
    border: 2px solid rgba(92, 169, 255, 0.12);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(92, 169, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.device-frame .device-screen {
    overflow: hidden;
    border-radius: 26px;
    position: relative;
    background: #000;
}
.device-frame .device-screen img {
    display: block;
    width: 100%;
    height: auto;
}
.device-frame .device-bar {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    z-index: 3;
}
.device-frame-sm {
    border-radius: 24px;
    padding: 6px;
}
.device-frame-sm .device-screen {
    border-radius: 18px;
}

/* ---- Screenshot Carousel ---- */
.carousel-section {
    max-height: 520px;
    overflow: visible;
}

.carousel-container {
    position: relative;
    max-width: 340px;
    margin: 0 auto;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
}
.carousel-track .carousel-slide {
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.carousel-track .carousel-slide img {
    width: 100%;
    max-height: 380px;
    object-fit: contain;
    cursor: pointer;
    transition: filter 0.3s ease;
    border-radius: 8px;
}
.carousel-track .carousel-slide img.loading {
    filter: blur(8px);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(6, 22, 46, 0.85);
    border: 1px solid rgba(92, 169, 255, 0.25);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
    font-size: 18px;
    line-height: 1;
    padding: 0;
}
.carousel-btn:hover {
    background: rgba(47, 107, 255, 0.3);
    border-color: var(--color-primary);
}
.carousel-btn.prev { left: -52px; }
.carousel-btn.next { right: -52px; }

@media (max-width: 480px) {
    .carousel-btn.prev { left: -6px; }
    .carousel-btn.next { right: -6px; }
    .carousel-btn {
        width: 34px;
        height: 34px;
        font-size: 14px;
        background: rgba(6, 22, 46, 0.92);
    }
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}
.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-gray);
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0;
}
.carousel-dot.active {
    background: var(--color-primary);
    width: 24px;
    border-radius: 4px;
}

/* ---- Lightbox ---- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 15, 36, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}
.lightbox-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(92, 169, 255, 0.15);
    border: 1px solid rgba(92, 169, 255, 0.3);
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    padding: 0;
    line-height: 1;
}
.lightbox-close:hover {
    background: rgba(92, 169, 255, 0.3);
}
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(6, 22, 46, 0.8);
    border: 1px solid rgba(92, 169, 255, 0.25);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 20px;
    padding: 0;
    line-height: 1;
}
.lightbox-nav:hover {
    background: rgba(47, 107, 255, 0.3);
}
.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }

/* ---- Feature Icons ---- */
.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.feature-icon svg {
    width: 28px;
    height: 28px;
}

/* ---- Cards ---- */
.app-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid rgba(92, 169, 255, 0.08);
    transition: border-color 0.25s ease, transform 0.25s ease;
}
.app-card:hover {
    border-color: rgba(92, 169, 255, 0.2);
    transform: translateY(-2px);
}

/* ---- Form Styles ---- */
.form-input {
    background: var(--color-bg-card);
    border: 1px solid rgba(92, 169, 255, 0.1);
    border-radius: var(--radius-input);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    padding: 14px 20px;
    width: 100%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    font-size: 0.95rem;
}
.form-input::placeholder {
    color: var(--color-text-tertiary);
}
.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(92, 169, 255, 0.1);
}
.form-input.textarea {
    resize: vertical;
    min-height: 140px;
}
.form-label {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
    display: block;
}

.file-upload {
    position: relative;
    background: var(--color-bg-card);
    border: 2px dashed rgba(92, 169, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.file-upload:hover {
    border-color: rgba(92, 169, 255, 0.4);
    background: rgba(92, 169, 255, 0.03);
}
.file-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* ---- Privacy Accept Button ---- */
.privacy-accept-btn {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    padding: 16px 20px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--color-bg-secondary) 60%, transparent);
    display: flex;
    justify-content: center;
}
.privacy-accept-btn .accept-btn {
    background: var(--btn-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius-full);
    padding: 16px 48px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(47, 107, 255, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 200px;
    line-height: 1.2;
}
.privacy-accept-btn .accept-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(47, 107, 255, 0.55);
}
.privacy-accept-btn.hidden {
    display: none;
}

/* ---- Section Divider ---- */
.section-divider {
    width: 60px;
    height: 3px;
    background: var(--btn-gradient);
    border-radius: 2px;
    margin: 0 auto;
}

/* ---- Decorative Glow ---- */
.glow-primary {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(47, 107, 255, 0.12) 0%, transparent 70%);
    pointer-events: none;
}
.glow-accent {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 217, 61, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

/* ---- Animations ---- */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}
@keyframes pulse-glow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--color-gray);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .carousel-container {
        max-width: 260px;
    }
    .carousel-track .carousel-slide img {
        max-height: 300px;
    }
    .device-frame {
        border-radius: 28px;
        padding: 7px;
    }
    .device-frame .device-screen {
        border-radius: 21px;
    }
}

@media (max-width: 480px) {
    .carousel-container {
        max-width: 220px;
    }
    .btn-primary, .btn-secondary, .btn-outline {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
}

/* ---- Print ---- */
@media print {
    .privacy-accept-btn,
    .carousel-btn,
    .lightbox-overlay {
        display: none !important;
    }
}
