/* Graphics Generator Tool Specific Styles */

.graphics-tool-wrapper {
    background-color: #1a1a1a;
    color: #e0e0e0;
    min-height: 80vh;
    padding: 20px 0;
    font-family: 'Lato', sans-serif;
}

.graphics-header {
    margin-bottom: 30px;
    text-align: left;
}

.graphics-header.text-center {
    text-align: center;
}

.graphics-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.style-tags {
    display: flex;
    gap: 10px;
}

.style-tags span {
    font-size: 13px;
    color: #3498db;
    font-weight: 600;
}

/* Workspace Layout */
.workspace {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 50px;
}

.preview-section {
    flex: 1;
    min-width: 400px;
}

.controls-section {
    flex: 0 0 380px;
    max-width: 380px;
    background: #252525;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

/* Preview Box */
.preview-container {
    background: #333;
    border-radius: 8px;
    position: relative;
    display: flex;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
    background-image:
        linear-gradient(45deg, #2b2b2b 25%, transparent 25%),
        linear-gradient(-45deg, #2b2b2b 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2b2b2b 75%),
        linear-gradient(-45deg, transparent 75%, #2b2b2b 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    /* Scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: #555 #1a1a1a;
}

.preview-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.preview-container::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.preview-container::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.preview-container::-webkit-scrollbar-thumb:hover {
    background: #777;
}

.preview-container::-webkit-scrollbar-corner {
    background: #1a1a1a;
}

#graphics-canvas {
    display: block;
}



/* Action Bar */
.action-bar {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.primary-btn {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.primary-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.download-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.download-btn {
    background: #27ae60;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.download-btn:hover {
    background: #219150;
}

/* Tabs */
.tabs-header {
    display: flex;
    background: #333;
    flex-shrink: 0;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #999;
    padding: 15px 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    color: #fff;
    background: #3a3a3a;
}

.tab-btn.active {
    color: #fff;
    background: #252525;
    border-bottom-color: #3498db;
}

.tabs-content {
    padding: 20px;
    flex: 1 1 0;
    overflow-y: auto;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Controls */
.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.control-group textarea,
.control-group input[type="number"],
.control-group input[type="text"],
.control-group input[type="range"] {
    width: 100%;
    background: #1a1a1a;
    border: 1px solid #444;
    color: #fff;
    padding: 10px;
    border-radius: 4px;
    font-size: 16px;
}

/* Range Input Styling */
.control-group input[type="range"] {
    -webkit-appearance: none;
    height: 6px;
    background: #333;
    border-radius: 5px;
    outline: none;
    padding: 0;
    margin: 15px 0;
    border: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #3498db;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.4);
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #2980b9;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.6);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #3498db;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.4);
}

.control-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

/* Custom Font Dropdown */
.custom-font-dropdown {
    position: relative;
    width: 100%;
    user-select: none;
}

.font-dropdown-selected {
    background: #1a1a1a;
    border: 1px solid #444;
    color: #fff;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.font-dropdown-selected::after {
    content: '▼';
    font-size: 12px;
    color: #888;
}

.font-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #252525;
    border: 1px solid #444;
    border-top: none;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    border-radius: 0 0 4px 4px;
    display: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.font-dropdown-list.open {
    display: block;
}

.font-dropdown-item {
    padding: 10px 15px;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    border-bottom: 1px solid #333;
}

.font-dropdown-item:last-child {
    border-bottom: none;
}

.font-dropdown-item:hover {
    background: #3498db;
}

/* Color Controls */
.color-presets {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #444;
    cursor: pointer;
}

input[type="color"] {
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    cursor: pointer;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed #444;
    padding: 30px;
    text-align: center;
    border-radius: 6px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover {
    border-color: #3498db;
    color: #fff;
    background: #2a2a2a;
}

.hidden-input {
    display: none;
}

/* More Styles Section & Gallery */
.more-styles-section {
    border-top: 1px solid #333;
    padding-top: 50px;
    margin-top: 40px;
}

/* More Styles Section & Gallery Overlay */
.more-styles-section {
    border-top: 1px solid #333;
    padding-top: 50px;
    margin-top: 60px;
}

.styles-grid {
    margin: 40px auto;
    max-width: 1100px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.style-card {
    background: #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
    /* Fix: Remove default link underline */
    border: 1px solid #333;
    display: block;
    color: inherit;
}

.style-card:hover {
    transform: translateY(-8px);
    border-color: #3498db;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-decoration: none !important;
    /* Fix: Ensure no underline on hover */
}

.style-card.active {
    border-color: #3498db;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.3);
}

.style-card .card-preview {
    position: relative;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.mini-preview-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.style-card .card-info {
    padding: 15px;
    text-align: center;
    background: #222;
    color: #e0e0e0;
    font-size: 15px;
    font-weight: 600;
    border-top: 1px solid #333;
}

.style-card.disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.style-card.disabled .card-info {
    color: #777;
}

/* Specific Style Card Previews */
.burning-bg {
    background: #0a0a0a !important;
    color: #ffd700;
    text-shadow: 0 0 15px #ff4500, 0 0 30px #ff0000;
}

.fire-inside-bg {
    background: #111 !important;
    color: #ff8800;
}

.neon-bg {
    background: #0a0a0a !important;
    color: #228c0d;
    text-shadow: 0 0 5px #228c0d, 0 0 15px #228c0d, 0 0 30px #0a3d0a;
}

.silver-bg {
    background: linear-gradient(135deg, #777 0%, #eee 50%, #777 100%) !important;
    color: #333;
    text-shadow: 1px 1px 1px #fff;
}

.download-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.secondary-btn {
    display: inline-block;
    background: linear-gradient(135deg, #1b7c62 0%, #145c48 100%);
    color: #fff !important;
    padding: 14px 36px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(27, 124, 98, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.secondary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transition: all 0.6s;
}

.secondary-btn:hover {
    transform: translateY(-5px) scale(1.03);
    background: linear-gradient(135deg, #219d7d 0%, #1b7c62 100%);
    box-shadow: 0 15px 30px rgba(27, 124, 98, 0.5);
    color: #fff !important;
}

.secondary-btn:hover::before {
    left: 100%;
}

.secondary-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(27, 124, 98, 0.4);
}

/* Tablet / Narrow-Desktop Adjustments (769px – 1050px)
   At this range the two panels can't sit side-by-side, so they stack.
   The controls panel must go full-width and the tab content height becomes auto. */
@media (min-width: 769px) and (max-width: 1050px) {
    .preview-section {
        min-width: 100%;
    }

    .controls-section {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .preview-container {
        height: 420px !important;
    }

    .tabs-content {
        flex: none !important;
        height: auto !important;
        overflow-y: visible !important;
    }

    .tab-pane {
        height: auto !important;
    }
}

/* Mobile Adjustments (≤768px) */
@media (max-width: 768px) {
    .controls-section {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .preview-section {
        min-width: 100%;
    }

    .preview-container {
        height: 320px !important;
    }

    .tabs-header {
        overflow-x: auto;
        white-space: nowrap;
        display: flex;
        -webkit-overflow-scrolling: touch;
        /* Smooth scroll on iOS */
    }

    .tab-btn {
        flex: 0 0 auto;
        min-width: 120px;
        padding: 20px 10px !important;
        font-size: 15px !important;
    }

    .composite-sub-tabs {
        overflow-x: auto;
        white-space: nowrap;
        display: flex;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .sub-tab-btn {
        flex: 0 0 auto;
        min-width: 110px;
        font-size: 14px !important;
        padding: 10px 15px !important;
    }

    .tabs-content {
        flex: none !important;
        height: auto !important;
        overflow-y: visible !important;
    }

    .tab-pane {
        height: auto !important;
    }
}

/* ── Flame Color Panel ───────────────────────────────────── */
.control-label-main {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.control-hint {
    font-size: 12px;
    color: #666;
    margin: 0 0 14px 0;
    line-height: 1.4;
}

.color-category {
    margin-bottom: 14px;
}

.color-category-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #333;
}

.color-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    outline: none;
}

.color-swatch:hover {
    transform: scale(1.2);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.color-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.custom-color-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.custom-color-row input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #444;
    padding: 2px;
    background: #1a1a1a;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.custom-color-row input[type="color"]:hover {
    border-color: #888;
}

.custom-color-hint {
    font-size: 12px;
    color: #555;
}

/* ── Text Stroke / Outline Controls ─────────────────────── */
.stroke-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

/* iOS-style toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
    cursor: pointer;
    margin: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #444;
    border-radius: 22px;
    transition: background 0.25s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.toggle-switch input:checked + .toggle-slider {
    background: #3498db;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
}

/* Stroke options panel — hidden until toggle is ON */
.stroke-options-panel {
    display: none;
    animation: fadeIn 0.2s ease;
}

.stroke-options-panel.visible {
    display: block;
}

/* Stroke color swatches inherit .color-swatch styles — just extend for white visibility */
.stroke-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

.stroke-swatch:hover {
    transform: scale(1.2);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.stroke-swatch.active {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.35);
    transform: scale(1.1);
}

/* White swatch needs a subtle border so it's visible on dark bg */
.stroke-swatch[data-color="#ffffff"] {
    border-color: #555;
}
.stroke-swatch[data-color="#ffffff"].active,
.stroke-swatch[data-color="#ffffff"]:hover {
    border-color: #3498db;
}