/* ==================================== */
/* 1. Global & Variables                */
/* ==================================== */
:root {
    --color-dark-bg: #1e1e2d;
    --color-dark-card: #27293d;
    --color-dark-text: #e0e0e0;
    --color-dark-muted: #9fa5b4;
    --color-primary: #5e72e4;
    --color-danger: #f5365c;

    /* Checkerboard variables (used in .editor-container) */
    --tile-size: 20px;
    --c1: #303030;
    --c2: #404040;
}

.custom-wide-container {
    width: 90%;
    max-width: 1600px;
    margin-right: auto;
    margin-left: auto;
    padding-right: var(--bs-gutter-x, 0.75rem);
    padding-left: var(--bs-gutter-x, 0.75rem);
}

body {
    font-family: "Inter", "Segoe UI", sans-serif;
    background: linear-gradient(135deg, var(--color-dark-bg) 0%, #171725 100%);
    color: var(--color-dark-text);
    min-height: 100vh;
    padding-bottom: 2rem;
}

/* ==================================== */
/* 2. Components                        */
/* ==================================== */
.navbar {
    background-color: var(--color-dark-card) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar-brand {
    color: var(--color-dark-text) !important;
    padding-top: 40;
    padding-bottom: 40;
    line-height: 1.25;
}

.navbar-brand .text-primary {
    color: var(--color-primary) !important;
}

.navbar-dark .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.25);
}

.navbar-dark .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"
        );
}

/* Optimized Mobile Navbar */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: var(--color-dark-card);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 15px;
        margin-top: 15px;
        padding: 20px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    }

    .navbar-nav .nav-item {
        text-align: center;
        /* Centers text for a cleaner mobile look */
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .navbar-nav .nav-item:last-child {
        border-bottom: none;
    }

    .navbar-nav .nav-link {
        padding: 12px 0 !important;
        font-size: 1.1rem;
    }

    /* Helper for full-width buttons on mobile */
    .w-mobile-100 {
        width: 100% !important;
        display: block;
    }
}

/* Fix for your brand padding issue */
.navbar-brand {
    padding-top: 10px !important;
    /* Changed from 40 to 10 */
    padding-bottom: 10px !important;
}

/* Profile photo for Navbar/About Section */
.profile-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    border: 2px solid var(--color-primary);
}

.card {
    background-color: var(--color-dark-card);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    color: var(--color-dark-text);
}

.card-header {
    background-color: var(--color-dark-card) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-dark-text) !important;
    padding: 1rem 1.5rem;
}

.card-header.bg-primary {
    background-color: var(--color-primary) !important;
}

/* Forms */
.form-label {
    color: var(--color-dark-muted);
}

.form-control {
    background-color: #323247;
    border: 1px solid #44445c;
    color: var(--color-dark-text);
}

.form-control:focus {
    background-color: #323247;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.25rem rgba(94, 114, 228, 0.25);
    color: var(--color-dark-text);
}

.form-select {
    background-color: #323247;
    border: 1px solid #44445c;
    color: var(--color-dark-text);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23e0e0e0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.25rem rgba(94, 114, 228, 0.25);
}

/* Range Sliders */
.form-range::-webkit-slider-thumb,
.form-range::-moz-range-thumb {
    width: 1rem;
    height: 1rem;
    background: var(--color-primary);
    border: 1px solid var(--color-primary);
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.5);
}

.form-range::-webkit-slider-runnable-track,
.form-range::-moz-range-track {
    background: #323247;
    border: 1px solid #44445c;
    height: 0.5rem;
    border-radius: 0.5rem;
}

/* Buttons */
.btn-close-white {
    filter: invert(1);
}

.btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-outline-danger {
    color: var(--color-danger);
    border-color: var(--color-danger);
}

.btn-outline-danger:hover {
    background-color: var(--color-danger);
    color: var(--color-dark-text);
}

.btn-outline-secondary {
    color: var(--color-dark-muted);
    border-color: #44445c;
}

.btn-outline-secondary:hover {
    background-color: #44445c;
    color: var(--color-dark-text);
}

.btn-outline-info {
    color: #4dc0c9;
    border-color: #4dc0c9;
}

.btn-outline-info:hover {
    background-color: #4dc0c9;
    color: var(--color-dark-text);
    border-color: #4dc0c9;
}

/* Modal Tabs */
.modal .nav-tabs .nav-link {
    color: var(--color-dark-muted);
}

.modal .nav-tabs .nav-link.active {
    color: var(--color-primary);
    background-color: var(--color-dark-bg);
    border-color: var(--color-primary) var(--color-primary) var(--color-dark-bg);
}

hr {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==================================== */
/* 3. Landing Page Sections             */
/* ==================================== */
.section-padding {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.hero-section {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding-top: 5rem;
}

.animation-preview {
    width: 90%;
    max-width: 1200px;
    height: 600px;
    margin: 0 auto;

    position: relative;
    padding-bottom: 56.25%;
    max-height: 90vh;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 5px solid var(--color-primary);
    animation: pulse-border 2s infinite alternate;
}

.animation-preview video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* Tablet Adjustments */
@media (max-width: 992px) {
    .animation-preview {
        height: 450px;
    }
}

/* Mobile Adjustments */
@media (max-width: 576px) {
    .animation-preview {
        width: 95%;
        /* Give it a bit more horizontal space on tiny screens */
        height: 250px;
        /* Adjusted height for mobile aspect ratio */
        margin-bottom: 2rem;
    }

    .hero-section {
        padding-top: 2rem;
        /* Reduce top padding on mobile */
    }

    .hero-section h1 {
        font-size: 1.8rem;
        /* Shrink title so it doesn't wrap awkwardly */
    }
}

.service-card {
    border: 1px solid rgba(94, 114, 228, 0.2);
    transition: transform 0.3s, border-color 0.3s;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
    box-shadow: 0 8px 25px rgba(94, 114, 228, 0.2);
}

.accordion-button {
    background-color: var(--color-dark-card) !important;
    color: var(--color-dark-text) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.accordion-button:not(.collapsed) {
    background-color: var(--color-primary) !important;
    color: white !important;
    box-shadow: none;
}

.accordion-body {
    background-color: var(--color-dark-bg);
    border: 1px solid var(--color-dark-card);
    border-top: none;
    color: var(--color-dark-muted);
}

@keyframes pulse-border {
    from {
        border-color: rgba(94, 114, 228, 0.4);
    }

    to {
        border-color: rgba(94, 114, 228, 1.0);
    }
}

/* ==================================== */
/* 4. Editor Layout                      */
/* ==================================== */
.tools-card {
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}

.tools-card .card-body {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 1.5rem !important;
}

.tools-card .card-body::-webkit-scrollbar {
    width: 8px;
}

.tools-card .card-body::-webkit-scrollbar-track {
    background: #323247;
    border-radius: 10px;
}

.tools-card .card-body::-webkit-scrollbar-thumb {
    background-color: var(--color-primary);
    border-radius: 4px;
}

.tools-card .card-body::-webkit-scrollbar-thumb:hover {
    background-color: #7c8bef;
}

.editor-container {
    width: 100%;
    max-width: 100%;
    height: 650px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
    background-image:
        linear-gradient(45deg, var(--c1) 25%, transparent 25%),
        linear-gradient(-45deg, var(--c1) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--c2) 75%),
        linear-gradient(-45deg, transparent 75%, var(--c2) 75%);
    background-size: var(--tile-size) var(--tile-size);
    background-position: 0 0, 0 0, 0 0, 0 0;
}

.spinner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.4); /* semi-transparent overlay */
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.overlay-item {
    position: absolute;
    border: 1px dashed var(--color-primary);
    cursor: grab;
    border-radius: 6px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    user-select: none;
    touch-action: none;
}

.overlay-item:hover {
    box-shadow: 0 0 15px rgba(94, 114, 228, 0.8);
}

.overlay-item.is-selected {
    border: 2px solid #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.overlay-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    border-radius: inherit;
}

/* ==================================== */
/* 5. Contact Section                     */
/* ==================================== */
#contact .card {
    background-color: var(--color-dark-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#contact .form-label {
    color: #ffffff !important;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

#contact .text-muted {
    color: var(--color-dark-text) !important;
    opacity: 0.8;
}

#contact .form-control {
    background-color: #1e1e2d;
    border: 1px solid #44445c;
    color: #ffffff !important;
}

#contact .form-control::placeholder {
    color: #6c757d !important;
}

#contact .form-control:focus {
    background-color: #1e1e2d;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.25rem rgba(94, 114, 228, 0.25);
    color: #ffffff;
}

/* ==================================== */
/* 6. Footer (Fixed for Mobile Alignment) */
/* ==================================== */

.footer-section {
    background-color: var(--color-dark-card);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    position: relative;
    z-index: 10;
}

.footer-section .text-muted {
    color: var(--color-dark-muted) !important;
    opacity: 1 !important;
}

.footer-links a {
    color: var(--color-dark-muted) !important;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
    /* Allows transform to work */
}

.footer-links a:hover {
    color: var(--color-primary) !important;
    transform: translateX(3px);
}

.footer-section hr {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.5;
}

.social-links a {
    font-size: 1.2rem;
    transition: color 0.2s ease;
}

.social-links a:hover {
    color: var(--color-primary) !important;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    /* Prevents dot from flattening */
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.tracking-wider {
    letter-spacing: 1px;
}

/* --- Mobile Specific Alignment Fixes --- */
@media (max-width: 991.98px) {
    .footer-section {
        text-align: center;
        /* Centers all text by default */
    }

    /* Centers the paragraph width-wise */
    .footer-section p {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Ensures the status dot and text are centered together */
    .footer-section .d-flex {
        justify-content: center !important;
    }

    /* Centers social icons */
    .social-links {
        justify-content: center !important;
        margin-bottom: 1.5rem;
    }

    /* Disable hover animation on touch devices for stability */
    .footer-links a:hover {
        transform: none !important;
    }

    /* Keeps "Explore" and "Legal" labels aligned with their lists on mobile */
    .footer-section h6 {
        margin-top: 1rem;
    }
}

@keyframes pulse-green {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.tracking-wider {
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .footer-section {
        text-align: center;
    }

    .footer-section .text-md-start,
    .footer-section .text-md-end {
        text-align: center !important;
    }

    .footer-links a:hover {
        transform: none;
        /* Disable horizontal slide on mobile */
    }
}

/* ==================================== */
/* 7. Responsive Adjustments             */
/* ==================================== */
@media (max-width: 992px) {
    .service-card {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 768px) {
    .tools-card {
        height: auto;
        min-height: 400px;
    }

    .hero-section {
        padding-top: 3rem;
    }
}

@media (max-width: 576px) {
    .hero-section .display-5 {
        font-size: 2rem;
    }

    .hero-section .lead {
        font-size: 1rem;
    }

    .animation-preview {
        padding-bottom: 75%;
        max-height: 60vh;
    }

    .card.p-5 {
        padding: 1.5rem !important;
    }

    .profile-photo {
        width: 28px;
        height: 28px;
    }

    #contact .card {
        padding: 1.5rem !important;
    }
}