/* ===========================================
   COMPONENTS.CSS - Bundled component styles
   NOTE: Keep source of truth in /css/modules/*.css
   =========================================== */

/* ===== modules/cards.css ===== */
/* ===========================================
   CARDS.CSS - Card components and stat values
   =========================================== */

.card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: var(--card-padding);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: none;
    width: 100%;
    box-sizing: border-box;
}

/* Utility Classes for Spacing */
.mt-sm {
    margin-top: 20px;
}

.mt-md {
    margin-top: 28px;
}

.mt-lg {
    margin-top: 40px;
}

@media (hover: hover) {
    .card:hover {
        transform: scale(1.02);
    }
}

.card-title {
    color: var(--primary);
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding-left: 2px;
    /* Компенсирует letter-spacing */
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    opacity: 1;
    text-shadow: 0 0 20px rgba(197, 165, 128, 0.6), 0 0 40px rgba(197, 165, 128, 0.3);
}

[data-theme="light"] .card-title {
    font-weight: 900 !important;
    text-shadow: none;
    /* font-size must remain identical to dark theme */
}

.card-center-title .card-title {
    justify-content: center;
}

.stat-value {
    font-size: 2.8em;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    text-shadow: 0 0 30px var(--primary-glow);
    letter-spacing: -1px;
}

/* Profile Grid */
#section-profile {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 40px;
}



.card-arrow {
    position: absolute;
    top: 24px;
    right: 24px;
    color: #444;
    transition: 0.3s;
}

/* ===========================================
   RESPONSIVE CARDS
   =========================================== */

/* Tablet */
@media (max-width: 768px) {
    .card {
        padding: calc(var(--card-padding) - 4px);
        border-radius: 20px;
    }

    .card-title {
        font-size: 0.9em;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .card {
        padding: 20px;
        border-radius: 24px;
    }

    .card-title {
        font-size: 0.8em;
        letter-spacing: 1.5px;
        gap: 8px;
    }

    .stat-value {
        font-size: 2.2em;
    }

    .card-arrow {
        top: 16px;
        right: 16px;
    }
}

/* Extra Small Mobile */
@media (max-width: 360px) {
    .card {
        padding: 16px;
        border-radius: 20px;
    }

    .card-title {
        font-size: 0.75em;
        letter-spacing: 1px;
    }

    .stat-value {
        font-size: 1.8em;
    }
}

/* ===== modules/buttons.css ===== */
/* ===========================================
   BUTTONS.CSS - All button components
   =========================================== */

/* Action Buttons inside Search */
.add-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 18px;
    background: var(--card-border);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@media (hover: hover) {
    .add-btn:hover {
        background: var(--primary-glow);
        color: var(--text-main);
        transform: scale(1.05);
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
        border-color: rgba(255, 255, 255, 0.2);
    }
}

/* Prominent Glass Button */
.btn-glass-prominent {
    width: 56px;
    height: 56px;
    border-radius: 20px;
    background: var(--card-border);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@media (hover: hover) {
    .btn-glass-prominent:hover {
        background: var(--primary-glow);
        color: var(--text-main);
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.25);
        border-color: rgba(255, 255, 255, 0.2);
    }
}

/* Primary Button */
.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    transition: background 0.2s;
}

.btn-primary:hover {
    filter: brightness(0.9);
}

.btn-primary-dark {
    background: var(--primary-dark);
    color: #fff;
}

.btn-primary-dark:hover {
    background: #7A634D;
}

/* Icon Round Button */
.btn-icon-round {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

[data-theme="light"] .btn-icon-round {
    color: #000;
}

.btn-icon-round:hover {
    border-color: var(--primary);
    background: transparent;
}

.btn-icon-round:hover .material-symbols-outlined {
    color: #fff !important;
    text-shadow: 0 0 15px var(--primary-glow) !important;
}

[data-theme="light"] .btn-icon-round:hover .material-symbols-outlined {
    color: #000 !important;
    text-shadow: none !important;
}

/* Gray Icon Button */
.btn-gray-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

@media (hover: hover) {
    .btn-gray-icon:hover {
        background: var(--nav-bg);
        border-color: var(--primary);
        transform: scale(1.05);
        box-shadow: 0 0 15px var(--primary-glow);
    }
}

/* FAB for Requests */
.fab-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

@media (hover: hover) {
    .fab-btn:hover {
        transform: scale(1.05);
        box-shadow: 0 0 20px var(--primary-glow);
    }
}

/* Support Button with Glow */
.btn-support-glow {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 12px 24px;
    border-radius: 24px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: none;
}

.btn-support-glow:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: var(--border-glass);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(-4px);
    color: #a38970;
}

/* Light Theme Override - Match Instruction Tiles */
[data-theme="light"] .btn-support-glow {
    background: var(--nav-bg);
    border-color: var(--nav-border);
    color: var(--text-main);
}

[data-theme="light"] .btn-support-glow:hover {
    background: var(--card-bg);
    border-color: var(--primary);
    color: var(--text-main);
    color: var(--text-main);
    box-shadow: 0 6px 16px rgba(197, 165, 128, 0.3);
}

/* Desktop Theme Toggle Tweaks */
#theme-btn,
#logout-btn {
    background: transparent !important;
    border: 1.5px solid rgba(255, 255, 255, 0.3) !important;
}

[data-theme="light"] #theme-btn,
[data-theme="light"] #logout-btn {
    border: 1.5px solid rgba(0, 0, 0, 0.7) !important;
    color: #000 !important;
}

/* ===== modules/modals.css ===== */
/* ===========================================
   MODALS.CSS - Modal overlays and inputs
   =========================================== */

.modal-input {
    width: 100%;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 14px 16px;
    color: var(--text-main);
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    margin-bottom: 20px;
}

/* Light theme - black border */
[data-theme="light"] .modal-input {
    border-color: rgba(0, 0, 0, 0.4);
}

.modal-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .modal-input::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.modal-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(183, 134, 79, 0.2);
}

.modal-center-title {
    text-align: center;
    width: 100%;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-main);
}

/* Request History Items - Prevent Overflow */
.requests-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin-bottom: 8px;
    gap: 8px;
}

.requests-history-item>div:first-child {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.requests-history-item>div:first-child>div>div:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delete-request-btn {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="light"] .delete-request-btn {
    color: #000;
}



.instruction-alert {
    background: transparent !important;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: start;
    gap: 10px;
}

[data-theme="light"] .instruction-alert {
    border-color: rgba(0, 0, 0, 0.4);
    /* color: #000; - REMOVED to allow bronze override */
}


.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
    /* Allow scroll if modal is tall */
    touch-action: pan-y !important;
    /* Enable touch scroll */
    overscroll-behavior: contain;
    /* Stop chain */
    overscroll-behavior: contain;
    /* Stop chain */
    opacity: 0;
    transition: opacity 0.2s ease, backdrop-filter 0.2s ease;
    pointer-events: none;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

/* Ensure generic alerts/confirms are ALWAYS on top of specific modals */
#custom-modal-overlay {
    z-index: 10005;
}

/* Dark modal background for instruction & payment modals (match tariff modal) */
#instruction-content,
#payment-modal>.modal {
    background: var(--modal-bg) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none !important;
}

.modal {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    width: 100%;
    max-width: 450px;
    padding: 24px;
    box-shadow: none;
}

/* Light Theme - Restore Rich Shadow (All sides) */
[data-theme="light"] .modal {
    box-shadow: 0 10px 60px rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.5);
    /* Lighter border to blend with shadow */
}

/* Modal Close Button - Always visible, no hover, theme colors */
.modal .btn-icon-round {
    opacity: 1 !important;
    color: var(--text-main) !important;
    background: transparent !important;
    border: none !important;
    transition: none !important;
}

.modal .btn-icon-round:hover {
    color: var(--text-main) !important;
    background: transparent !important;
    transform: none !important;
}

[data-theme="light"] .modal .btn-icon-round {
    color: #000 !important;
}

/* Request Warning - Light theme border */
[data-theme="light"] .request-warning {
    border-color: rgba(0, 0, 0, 0.2) !important;
    color: #000 !important;
}

/* Copy Tooltip */
/* Copy Tooltip - High Contrast */
.copy-tooltip {
    position: fixed;
    /* Dark Theme Default: White BG, Black Text */
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85em;
    pointer-events: none;
    z-index: 1000000;
    font-weight: 600;
    backdrop-filter: blur(4px);
    border: 1px solid var(--border-glass);
    animation: fadeOutTooltip 1.2s forwards;
    pointer-events: none;
    font-weight: 600;
    z-index: 1000000;
}

[data-theme="light"] .copy-tooltip {
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

@keyframes fadeOutTooltip {
    0% {
        opacity: 0;
        transform: translate(-50%, 10px);
    }

    10% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    80% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -10px);
    }
}

/* Modal Cancel Button - High Contrast Inversion */
.btn-modal-cancel {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: #fff !important;
    flex: 1;
    border-radius: 12px;
    padding: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

.btn-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="light"] .btn-modal-cancel {
    border-color: rgba(0, 0, 0, 0.3) !important;
    color: #000 !important;
}

[data-theme="light"] .btn-modal-cancel:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

/* ===== modules/search.css ===== */
/* ===========================================
   SEARCH.CSS - Search, Catalog, Domains
   =========================================== */

/* Light Theme Override for buttons inside search */
[data-theme="light"] .add-btn,
[data-theme="light"] #clear-search-btn {
    color: var(--text-main);
    border-color: var(--card-border);
}

/* Search Container */
.search-container {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 20px auto 24px auto;
    /* Restored margins */
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 6px 6px 6px 16px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

[data-theme="light"] .search-container {
    background: rgba(255, 255, 255, 0.95);
    /* Lighter than card-bg to match tiles */
}

.search-container:focus-within {
    border-color: rgba(255, 255, 255, 0.2);
}

.search-icon {
    width: 20px;
    height: 20px;
    fill: #888;
    margin-right: 12px;
    display: flex;
    align-items: center;
}

[data-theme="light"] .search-icon {
    fill: var(--text-main);
}

.search-bar {
    border: none;
    background: transparent;
    padding: 0;
    height: 48px;
    flex-grow: 1;
    color: var(--text-main);
    font-size: 16px;
    outline: none;
    font-family: inherit;
    min-width: 0;
}

.search-bar::placeholder {
    font-family: 'Inter', sans-serif;
    font-size: 0.95em;
    letter-spacing: 0;
    color: #888;
    opacity: 1;
}

/* Catalog Container */
.catalog-container {
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    max-height: 60vh;
    margin-bottom: 20px;
    box-shadow: none;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    /* For scroll button positioning */
}

[data-theme="light"] .catalog-container {
    background: rgba(255, 255, 255, 0.95);
}



.catalog-scroller {
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 80px;
    box-sizing: border-box;
    scrollbar-width: none;
    /* Firefox - hide scrollbar */
    -ms-overflow-style: none;
    /* IE/Edge - hide scrollbar */
    touch-action: pan-y !important;
    /* Enable scroll inside this container */
    overscroll-behavior: auto;
    /* allow bounce inside */
}

/* Webkit (Chrome, Safari, Edge) - hide scrollbar */
.catalog-scroller::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* Domain Grid */
.domain-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.domain-tile {
    background: var(--nav-bg);
    border-radius: 28px;
    padding: 14px;
    text-align: center;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: background 0.04s, border-color 0.04s, transform 0.04s;
    box-sizing: border-box;
    width: 100%;
    margin-bottom: 10px;
}

[data-theme="light"] .domain-tile {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.2);
}

/* Bronze hover border - ONLY on pointer devices (not touch) - THICKER to prevent pixelation */
@media (hover: hover) and (pointer: fine) {
    .domain-tile:hover {
        border: 2.5px solid var(--primary) !important;
        transform: translateY(-2px);
    }
}

/* Bronze flash on click (40ms) - same on all themes */
.domain-tile:active,
.domain-tile.copied {
    transform: scale(0.98) translateY(0);
    border-color: #C5A580 !important;
    background: rgba(197, 165, 128, 0.3) !important;
}

.domain-name {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.85em;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.domain-category {
    font-size: 0.7em;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Light Theme: Make count badge visible (black) */
[data-theme="light"] .domain-category {
    color: #333;
}

/* ===== modules/dns.css ===== */
/* ===========================================
   DNS.CSS - DNS config blocks and blur
   =========================================== */

/* Private DNS Blocks - Visual Match with .card */
/* Private DNS Blocks - Visual Match with .card */
/* Private DNS Blocks - Visual Match with .card but lighter to compensate nesting */
.dns-config-block {
    position: relative;
    overflow: hidden;

    background: transparent;

    border-radius: 20px;
    padding: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    text-align: center;

    border: 1.5px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: background 0.04s, border-color 0.04s, transform 0.04s;
}

[data-theme="light"] .dns-config-block {
    background: transparent !important;
    border-color: rgba(0, 0, 0, 0.4);
    color: var(--text-main);
}

/* Thicker borders in Instruction Modals */
.modal .dns-config-block {
    border: 2px solid rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .modal .dns-config-block {
    border: 2px solid rgba(0, 0, 0, 0.3) !important;
}

[data-theme="light"] .dns-config-block .code-text {
    color: var(--text-main) !important;
}


/* === EXACT COPY FROM domain-tile - DO NOT MODIFY === */

/* Bronze hover border - ONLY on pointer devices */
@media (hover: hover) and (pointer: fine) {
    .dns-config-block:hover {
        border: 2.5px solid var(--primary) !important;
    }
}

/* Bronze flash on click - same on all themes */
.dns-config-block:active,
.dns-config-block.copied {
    transform: scale(0.98);
    border-color: #C5A580 !important;
    background: rgba(197, 165, 128, 0.3) !important;
}

/* === DNS VEIL (Eye Icon Overlay) === */
.dns-veil {
    /* Mobile (Default) - Veil blocks interaction */
    position: absolute;
    /* Fix displacement */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    z-index: 100;
    transition: opacity 0.3s ease;
    pointer-events: auto;
    cursor: pointer;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dns-veil .material-symbols-outlined {
    opacity: 0.4 !important;
    /* User requested 40% */
    color: #fff;
    /* White on Dark Theme */
}

[data-theme="light"] .dns-veil .material-symbols-outlined {
    color: #000 !important;
    /* Black on Light Theme */
}

/* Hide eye icon when secrets are revealed (Mobile) */
.dns-veil.hidden {
    opacity: 0 !important;
    pointer-events: none;
}

/* Hiding Sensitive Data via Opacity */
.blur-secret {
    opacity: 0;
    transition: opacity 0.3s ease;
    user-select: none;
}

.blur-secret.revealed {
    opacity: 1;
    user-select: text;
}

/* Desktop: Eye is decorative only, fades on hover */
@media (min-width: 481px) {
    .dns-veil {
        pointer-events: none !important;
        /* Clicks pass through to blocks */
        cursor: default;
    }

    .dns-fields-wrapper:hover .dns-veil {
        opacity: 0 !important;
    }

    /* Auto-reveal secrets on hover for Desktop */
    .dns-config-block:hover .blur-secret {
        opacity: 1;
        user-select: text;
    }
}

/* Brighter background for DNS blocks inside dark modals */
.modal .dns-config-block {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Force text wrapping for long DoH URLs */
.dns-config-block .code-text {
    overflow-wrap: anywhere;
    word-break: break-all;
    white-space: normal;
    display: block;
    width: 100%;
    max-width: 100%;
}

/* ===== modules/instructions.css ===== */
/* ===========================================
   INSTRUCTIONS.CSS - Instruction cards and grid
   =========================================== */

.section-title-tile {
    font-weight: 800;
    margin: 0 auto 32px auto;
    width: fit-content;
    text-align: center;
    letter-spacing: 2px;
    font-size: 1.1em;
    color: var(--primary);
    text-transform: uppercase;

    /* Tile Look */
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 12px 32px;
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);

    transition: transform 0.3s ease;
}

.section-title-tile:hover {
    transform: translateY(-2px);
    background: var(--card-bg);
    /* Ensure background stays same */
    /* No filter brightness or glow */
}

[data-theme="light"] .section-title-tile {
    background: var(--nav-bg);
    border-color: var(--nav-border);
}

/* Selection Tiles (Browser/Router) */
.selection-tile {
    background: var(--card-border);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: background 0.2s, border-color 0.2s;
}

[data-theme="light"] .selection-tile {
    background: transparent;
    border-color: rgba(0, 0, 0, 0.4);
    /* Match DNS border */
}

[data-theme="light"] .selection-tile:hover {
    background: transparent;
    border-color: #000 !important;
}

[data-theme="light"] .selection-tile .material-symbols-outlined,
[data-theme="light"] .selection-tile .card-title,
[data-theme="light"] .selection-tile div {
    color: #000 !important;
}

/* Dark Theme Hover - White Border */
.selection-tile:hover {
    border-color: #fff;
    background: var(--card-border);
}

.selection-tile:active {
    transform: scale(0.98);
    box-shadow: none !important;
}

.instructions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
}

.instruction-card {
    cursor: pointer;
    position: relative;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    align-items: center;
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 24px;
}

[data-theme="light"] .instruction-card {
    background: var(--nav-bg);
    border-color: var(--nav-border);
}

/* Dark Theme Hover - White Border, No Shadow */
.instruction-card:hover {
    background: var(--card-bg);
    border-color: #fff;
    transform: translateY(-4px);
    box-shadow: none !important;
}

[data-theme="light"] .instruction-card:hover {
    border-color: #000 !important;
}

.instruction-card:active {
    transform: scale(0.98);
    box-shadow: none !important;
    border-color: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .instruction-card:active {
    border-color: rgba(0, 0, 0, 0.6) !important;
}

.instruction-card .card-title {
    margin-bottom: 8px;
    color: var(--text-main);
    font-size: 1.1em;
    text-shadow: none;
    /* Clean look */
}

/* Force BLACK on Light Theme (Overrides dashboard !important) */
[data-theme="light"] .instruction-card .card-title,
[data-theme="light"] .instruction-card .card-title svg,
[data-theme="light"] .instruction-card .card-title span {
    color: #000 !important;
    text-shadow: none !important;
}

.instruction-card:hover .card-title {
    color: var(--text-main);
    text-shadow: none;
}

.instruction-card p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9em;
    line-height: 1.4;
}

[data-theme="light"] .instruction-card p {
    color: #333 !important;
}

.instruction-card:hover .card-arrow {
    color: var(--text-main);
    transform: translateX(4px);
}

[data-theme="light"] .instruction-card:hover .card-arrow {
    color: #000 !important;
}

/* ===== modules/tariffs.css ===== */
/* ===========================================
   TARIFFS.CSS - Tariff modal and cards
   =========================================== */

.tariff-modal-content {
    max-width: 420px;
    /* More compact */
    background: var(--modal-bg) !important;
    /* Force dark background */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none !important;
}

.tariff-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    /* Compact gap */
    margin-top: 16px;
}

.tariff-card {
    background: var(--card-border);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    /* Stack Header and Body */
    gap: 4px;
}

.tariff-card:hover {
    background: var(--card-border);
    border-color: rgba(197, 165, 128, 0.3);
    /* Bronze hint */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tariff-header-centered {
    text-align: center;
    font-size: 1.1em;
    font-weight: 700;
    color: var(--primary);
    /* Bronze title */
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.tariff-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tariff-features-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tariff-feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: var(--text-secondary);
    font-weight: 500;
}

.tariff-price-box {
    text-align: right;
}

.tariff-price {
    font-size: 1.4em;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.tariff-price span {
    font-size: 0.5em;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 2px;
}

.tariff-note {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.75em;
    margin-top: 20px;
}

/* Modal Title Refinement */
.modal-center-title {
    font-size: 1.2em;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

/* ===== modules/responsive.css ===== */
/* ===========================================
   RESPONSIVE.CSS - Media queries
   =========================================== */

/* Tablet Responsive */
@media (max-width: 768px) {
    .instructions-grid {
        gap: 12px;
    }

    .instruction-card {
        padding: 20px;
    }

    .instruction-card .card-title {
        font-size: 1em;
    }

    .modal {
        padding: 20px;
        margin: 10px;
    }
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .instructions-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stat-value {
        font-size: 2rem;
    }

    .card-title {
        justify-content: center;
        text-align: center;
        color: var(--primary);
        text-shadow: 0 0 10px rgba(197, 165, 128, 0.4);
    }

    #plan-name-title {
        text-transform: none !important;
    }

    .domain-category {
        color: #ddd;
    }

    /* DNS Config Blocks - Better mobile text */
    .dns-config-block {
        padding: 14px 12px;
    }

    .dns-config-block .code-text {
        font-size: 0.7em;
        word-break: break-all;
        white-space: normal;
        line-height: 1.4;
    }

    .dns-fields-wrapper {
        margin-top: 20px !important;
    }

    /* Instruction Cards - Trimmed sides, rounded like nav bar */
    .instruction-card {
        padding: 18px 16px;
        border-radius: 28px;
        margin-left: 4px;
        margin-right: 4px;
    }

    .instruction-card .card-title {
        font-size: 0.95em;
        gap: 8px;
    }

    .instruction-card p {
        font-size: 0.8em;
        line-height: 1.3;
    }

    /* Hide arrow icons on mobile */
    .card-arrow {
        display: none !important;
    }

    .section-title-tile {
        font-size: 0.95em;
        padding: 10px 24px;
        letter-spacing: 1.5px;
        margin-bottom: 24px;
    }

    /* Search Container */
    .search-container {
        padding: 4px 4px 4px 12px;
        margin: 16px auto 20px auto;
    }

    .search-bar {
        height: 44px;
        font-size: 14px;
    }

    .add-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        border-radius: 14px;
    }

    /* Catalog Container */
    .catalog-container {
        max-height: 55vh;
        border-radius: 18px;
    }

    .catalog-scroller {
        padding: 16px 16px 70px 16px;
    }

    /* Domain Tiles - Mobile adjustments only, inherit theme colors */
    .domain-tile {
        padding: 10px;
        border-radius: 28px;
    }

    .domain-name {
        font-size: 0.8em;
    }

    /* Support Button */
    .btn-support-glow {
        font-size: 14px;
        padding: 10px 20px;
    }

    /* Modals */
    .modal {
        padding: 20px;
        border-radius: 20px;
        max-width: calc(100vw - 32px);
    }

    .modal-center-title {
        font-size: 1em;
    }

    .modal-input {
        padding: 12px 14px;
        font-size: 15px;
    }

    /* Tariffs */
    .tariff-card {
        padding: 16px;
        border-radius: 14px;
    }

    .tariff-name {
        font-size: 1.1em;
    }

    /* Mobile Logout Button */
    .btn-logout-mobile {
        padding: 8px 24px;
        background: transparent;
        border: none;
        /* No border, just text */
        border-radius: 12px;
        color: #888;
        font-size: 0.8em;
        cursor: pointer;
        transition: all 0.2s;
    }

    .btn-logout-mobile:active {
        opacity: 0.7;
        transform: scale(0.95);
    }

    [data-theme="light"] .btn-logout-mobile {
        border-color: rgba(0, 0, 0, 0.1);
        color: #666;
    }

    .tariff-price {
        font-size: 1.7em;
    }

    .tariff-features {
        flex-direction: column;
        gap: 8px;
        font-size: 0.8em;
    }
}

/* Extra Small Mobile */
@media (max-width: 400px) {
    .domain-name {
        font-size: 0.75em;
    }

    .dns-config-block .code-text {
        font-size: 0.65em;
    }

    .instruction-card .card-title {
        font-size: 0.85em;
    }

    .instruction-card p {
        font-size: 0.75em;
    }

    .section-title-tile {
        font-size: 0.85em;
        padding: 8px 18px;
    }

    .btn-support-glow {
        font-size: 13px;
        padding: 8px 16px;
    }

    .search-bar {
        font-size: 13px;
    }
}

/* Very Small Mobile (320px) */
@media (max-width: 360px) {
    .container {
        padding: 0 8px 20px 8px;
    }

    .dns-config-block {
        padding: 12px 10px;
    }

    .dns-config-block .code-text {
        font-size: 0.6em;
    }

    .instruction-card {
        padding: 14px;
    }

    .catalog-scroller {
        padding: 12px 12px 60px 12px;
    }

    .tariff-price {
        font-size: 1.5em;
    }
}

/* ===== modules/warning-modal.css ===== */
/* ============================================
   First-Time Buyer Warning Modal (Premium Style)
   ============================================ */

.warning-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(14px) !important;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.warning-modal {
    background: var(--modal-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 24px;
    border: 1px solid var(--card-border);
    max-width: 420px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);

    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.warning-modal.shake {
    animation: shake 0.5s !important;
}

.warning-modal::-webkit-scrollbar {
    display: none;
}

@keyframes slideUp {
    from {
        transform: translateY(40px) scale(0.98);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Header */
.warning-modal-header {
    padding: 32px 32px 16px 32px;
    text-align: center;
}

.warning-modal-title {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

[data-theme="light"] .warning-modal-title {
    color: #111;
}

.warning-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

/* Content */
.warning-modal-content {
    padding: 16px 32px 0 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.warning-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Subtle border */
    transition: transform 0.2s;
}

[data-theme="light"] .warning-section {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

.warning-section-title {
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

[data-theme="light"] .warning-section-title {
    color: #111;
}

.section-icon {
    width: 16px;
    height: 16px;
}

.section-icon.success {
    color: #10B981;
}

.section-icon.error {
    color: #EF4444;
}

.section-icon.info {
    color: var(--primary);
}

.warning-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.warning-list li {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
    color: var(--text-secondary);
    /* Softer text */
    font-size: 13px;
    line-height: 1.5;
    font-weight: 400;
}

[data-theme="light"] .warning-list li {
    color: #333;
    font-weight: 500;
}

.warning-list li strong {
    color: var(--text-main);
    font-weight: 600;
}

[data-theme="light"] .warning-list li strong {
    color: #000;
    font-weight: 700;
}

.warning-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-secondary);
}

.warning-list.success li::before {
    background: #10B981;
}

.warning-list.error li::before {
    background: #EF4444;
}

/* Custom ticks/crosses replacer with just dots or specific SVG logic from JS? 
   The JS injects SVGs into list items if needed? No, JS just adds text.
   So CSS ::before handles bullets. 
*/

/* Footer */
.warning-footer-note {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
    font-style: normal;
    background: rgba(197, 165, 128, 0.05);
    /* Slight bronze tint bg */
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(197, 165, 128, 0.1);
}

[data-theme="light"] .warning-footer-note {
    color: #333;
}

.warning-modal-footer {
    padding: 24px 32px 32px 32px;
    display: flex;
    justify-content: center;
}

.warning-confirm-btn {
    background: var(--primary);
    color: #000;
    /* Bronze standard is black text on gold */
    border: none;
    padding: 14px 32px;
    border-radius: 16px;
    /* Pillow shape */
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    letter-spacing: 0.5px;
    width: auto;
}

[data-theme="light"] .warning-confirm-btn {
    color: #fff;
    /* White text on light theme bronze */
}

.warning-confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(197, 165, 128, 0.4);
    background: #D4B48F;
    /* Lighter bronze on hover */
}

.warning-confirm-btn:active {
    transform: translateY(0);
}

/* Mobile */
@media (max-width: 600px) {
    .warning-modal {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
        background: black;
        /* Full black on mobile for performance/focus? Or keep glass */
        background: var(--bg-body);
    }

    .warning-modal-header {
        padding: 60px 24px 20px;
    }

    .warning-modal-content {
        padding: 0 24px;
    }

    .warning-modal-footer {
        padding: 24px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(to top, var(--bg-body) 80%, transparent);
        z-index: 10;
    }

    .warning-modal-content {
        padding-bottom: 100px;
        /* Space for fixed footer */
    }
}


