html {
    scroll-behavior: smooth;
}

p {
    text-align: justify;
}

/* Base Styles and Tailwind Overrides */
html,
body {
    background-color: #111111;
    color: #ffffff;
    background-image:
        radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.03) 1px, transparent 0),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100px 100px, 50px 50px, 50px 50px;
    background-attachment: fixed;
    margin: 0;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    width: 100%;
}

::selection {
    background-color: rgba(43, 43, 238, 0.5);
    /* logo-blue with 50% opacity */
}

/* Custom Utilities and Components */
.circuit-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.15;
    /* Transparentado */
    background-image: url('assets/img/circuit-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    /* Parallax effect */
}

.metallic-text {
    background: linear-gradient(180deg, #fff 0%, #d1d1d1 45%, #a0a0a0 50%, #f0f0f0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    letter-spacing: -0.05em;
    font-family: "Outfit", sans-serif;
}

.metallic-silver {
    background: linear-gradient(145deg, #e6e6e6 0%, #999 50%, #4d4d4d 100%);
}

.tidal-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(26, 26, 26, 0.9);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: all 0.5s ease;
}

.text-huge {
    font-size: clamp(2rem, 8vw, 5.5rem);
    line-height: 0.95;
    word-break: break-word;
}

.editorial-gradient {
    background: linear-gradient(180deg, rgba(17, 17, 17, 0) 0%, rgba(17, 17, 17, 0.7) 60%, rgba(17, 17, 17, 0.98) 100%);
}

.sharp-edge {
    border-radius: 1px;
}

.service-gradient-red {
    background: radial-gradient(circle at bottom right, rgba(179, 26, 26, 0.25) 0%, transparent 70%);
}

.service-gradient-blue {
    background: radial-gradient(circle at bottom right, rgba(26, 77, 140, 0.25) 0%, transparent 70%);
}

.circuit-bg-section {
    background-image: radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.08) 1px, transparent 0);
    background-size: 32px 32px;
}

.connector-line-blue {
    background: linear-gradient(90deg, #1a4d8c 0%, transparent 100%);
    height: 1px;
}

.connector-line-red {
    background: linear-gradient(90deg, transparent 0%, #b31a1a 50%, transparent 100%);
    height: 1px;
}

.parallax-section {
    position: relative;
    background-image: linear-gradient(rgba(17, 17, 17, 0.88), rgba(17, 17, 17, 0.88)), url('assets/img/circuit-bg.png');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
}

@media (max-width: 1024px) {
    .parallax-section {
        background-attachment: fixed;
        /* Try to keep it on mobile if supported, or scroll if not */
        background-size: cover;
    }
}

/* Modal Styles */
#serviceModal {
    display: none;
    /* Default hidden */
    opacity: 0;
    -webkit-transition: opacity 0.5s ease;
    transition: opacity 0.5s ease;
}

#serviceModal.active {
    opacity: 1;
}

#serviceModal:not(.hidden) {
    display: flex;
    /* Shown when not hidden class is present */
}

#serviceModal .modal-content {
    -webkit-transform: scale(0.95);
    transform: scale(0.95);
    opacity: 0;
    -webkit-transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

#serviceModal.active .modal-content {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
}

.modal-overlay {
    cursor: pointer;
    -webkit-transition: opacity 0.5s ease;
    transition: opacity 0.5s ease;
}

/* Fallback for backdrop-filter on older Androids */
.backdrop-blur-md,
.backdrop-blur-xl {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {

    .bg-container-gray\/95,
    .bg-circuit-gray\/95 {
        background-color: rgba(26, 26, 26, 0.98) !important;
    }
}

.problem-text {
    border-left: 4px solid #b31a1a;
    padding-left: 1.5rem;
}

.solution-text {
    border-left: 4px solid #1a4d8c;
    padding-left: 1.5rem;
}

/* Chatbot Styles */
#chatWindow.active {
    opacity: 1;
    -webkit-transform: scale(1);
    transform: scale(1);
    pointer-events: auto;
}

.scrollbar-thin::-webkit-scrollbar {
    width: 4px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: rgba(43, 43, 238, 0.5);
}

@media (max-width: 768px) {
    #chatWindow {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}