/* ========================================
   SPINTAX GENERATOR – COMPLETE STYLES
   ======================================== */

/* Wrapper Reset */
.spintax-app-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.7;
    color: #1a1a2e;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- Header ---------- */
.spintax-header {
    margin-bottom: 28px;
}

.spintax-lead {
    font-size: 1.15em;
    font-weight: 700;
    margin-bottom: 0.6em;
    color: #1a1a2e;
}

.spintax-privacy-badge {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 0.82em;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    margin-top: 6px;
}

/* ---------- Tool Container ---------- */
.spintax-tool-container {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border: 1px solid #d8dff5;
    padding: 28px 24px 20px;
    border-radius: 14px;
    margin: 24px 0;
    position: relative;
    box-shadow: 0 2px 16px rgba(0,0,0,0.04);
}

/* Two-column grid: input → arrow → output */
.spintax-tool-grid {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    gap: 12px;
    align-items: start;
}

/* Label rows */
.spintax-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.spintax-tool-container label {
    font-weight: 700;
    font-size: 0.92em;
    color: #333;
}

.spintax-char-count {
    font-size: 0.78em;
    color: #888;
    font-weight: 500;
}

.spintax-output-badge {
    font-size: 0.72em;
    font-weight: 700;
    background: #4caf50;
    color: #fff;
    padding: 1px 10px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Textareas */
.spintax-tool-container textarea {
    width: 100%;
    height: 170px;
    padding: 14px;
    border: 2px solid #dce1ef;
    border-radius: 10px;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 13.5px;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
    background: #fff;
    color: #1a1a2e;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.spintax-tool-container textarea:focus {
    outline: none;
    border-color: #5c6bc0;
    box-shadow: 0 0 0 3px rgba(92, 107, 192, 0.15);
}

.spintax-tool-container textarea[readonly] {
    background: #fafbff;
    cursor: default;
}

/* Input wrapper needs relative for clear button */
.input-group {
    position: relative;
}

/* Clear button inside input */
.spintax-clear-btn {
    position: absolute;
    top: 42px;
    right: 8px;
    background: #e0e0e0;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 16px;
    line-height: 26px;
    text-align: center;
    cursor: pointer;
    color: #555;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
    padding: 0;
}

.spintax-clear-btn:hover {
    background: #f44336;
    color: #fff;
}

/* ---------- Arrow Column ---------- */
.spintax-arrow-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 36px;
    gap: 6px;
}

.spintax-arrow-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5c6bc0 0%, #3949ab 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
    box-shadow: 0 4px 14px rgba(57, 73, 171, 0.3);
    user-select: none;
}

.spintax-arrow-icon:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 22px rgba(57, 73, 171, 0.45);
}

.spintax-arrow-icon:active {
    transform: scale(0.95);
}

.spintax-arrow-icon.spintax-pulse {
    animation: spintaxPulse 0.45s ease;
}

@keyframes spintaxPulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.spintax-arrow-label {
    font-size: 0.7em;
    font-weight: 700;
    color: #5c6bc0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---------- Error Message ---------- */
.spintax-error-msg {
    background: #fdecea;
    color: #c62828;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.88em;
    font-weight: 600;
    margin-top: 12px;
    animation: spintaxShake 0.4s ease;
}

@keyframes spintaxShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ---------- Action Buttons ---------- */
.spintax-actions-row {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.spintax-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.25s, transform 0.15s, box-shadow 0.25s;
    user-select: none;
    line-height: 1;
}

.spintax-btn:active {
    transform: scale(0.97);
}

.spintax-btn-primary {
    background: linear-gradient(135deg, #5c6bc0 0%, #3949ab 100%);
    color: #fff;
    box-shadow: 0 3px 10px rgba(57, 73, 171, 0.25);
}

.spintax-btn-primary:hover {
    box-shadow: 0 5px 18px rgba(57, 73, 171, 0.4);
    background: linear-gradient(135deg, #6a79d1 0%, #4051b5 100%);
}

.spintax-btn-secondary {
    background: #fff;
    color: #3949ab;
    border: 2px solid #c5cae9;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.spintax-btn-secondary:hover:not(:disabled) {
    background: #e8eaf6;
    border-color: #9fa8da;
}

.spintax-btn-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.spintax-btn-secondary.spintax-copied {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

/* Hide desktop arrow generate on mobile, hide mobile button on desktop */
#generateBtnMobile {
    display: none;
}

/* ---------- Content Styles ---------- */
.spintax-divider {
    border: 0;
    border-top: 2px solid #e8eaf6;
    margin: 44px 0;
}

.spintax-content h2 {
    margin-top: 1.8em;
    margin-bottom: 0.6em;
    font-size: 1.35em;
    color: #1a1a2e;
    border-bottom: 3px solid #e8eaf6;
    padding-bottom: 10px;
}

.spintax-content h3 {
    color: #3949ab;
    margin-bottom: 0.5em;
}

.spintax-content ol,
.spintax-content ul {
    padding-left: 1.6em;
}

.spintax-content li {
    margin-bottom: 0.55em;
}

/* Example box */
.spintax-example-box {
    background: #fafbff;
    padding: 20px 24px;
    border-left: 5px solid #5c6bc0;
    border-radius: 0 12px 12px 0;
    margin: 24px 0;
}

.spintax-code-block {
    display: block;
    background: #1a1a2e;
    color: #a5d6a7;
    padding: 14px 18px;
    border-radius: 8px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
    margin: 10px 0 16px;
    overflow-x: auto;
    line-height: 1.6;
}

/* Warning note */
.spintax-warning-note {
    background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
    color: #6d5a00;
    padding: 16px 20px;
    border-radius: 10px;
    margin-top: 18px;
    border-left: 5px solid #ffc107;
    font-size: 0.93em;
}

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
    .spintax-tool-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .spintax-arrow-col {
        flex-direction: row;
        padding-top: 0;
        justify-content: center;
        gap: 10px;
    }

    .spintax-arrow-icon {
        width: 40px;
        height: 40px;
    }

    .spintax-arrow-icon svg {
        width: 20px;
        height: 20px;
        transform: rotate(90deg);
    }

    #generateBtnMobile {
        display: inline-flex;
    }

    .spintax-tool-container {
        padding: 18px 14px 16px;
    }

    .spintax-tool-container textarea {
        height: 130px;
    }

    .spintax-actions-row {
        flex-direction: column;
    }

    .spintax-btn {
        justify-content: center;
        width: 100%;
    }

    .spintax-example-box {
        padding: 16px;
    }
}

/* ---------- Accessibility: Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .spintax-arrow-icon,
    .spintax-btn,
    .spintax-tool-container textarea {
        transition: none !important;
    }
    .spintax-arrow-icon.spintax-pulse {
        animation: none !important;
    }
    .spintax-error-msg {
        animation: none !important;
    }
}

/* ---------- Dark Theme Support ---------- */
@media (prefers-color-scheme: dark) {
    .spintax-app-wrapper {
        color: #e0e0e0;
    }

    .spintax-lead {
        color: #e0e0e0;
    }

    .spintax-privacy-badge {
        background: #1b3a1d;
        color: #81c784;
    }

    .spintax-tool-container {
        background: linear-gradient(135deg, #1e1e2f 0%, #252540 100%);
        border-color: #3a3a5c;
        box-shadow: 0 2px 16px rgba(0,0,0,0.2);
    }

    .spintax-tool-container label {
        color: #ccc;
    }

    .spintax-tool-container textarea {
        background: #2a2a3d;
        border-color: #444466;
        color: #e0e0e0;
    }

    .spintax-tool-container textarea:focus {
        border-color: #7986cb;
        box-shadow: 0 0 0 3px rgba(121, 134, 203, 0.2);
    }

    .spintax-tool-container textarea[readonly] {
        background: #252538;
    }

    .spintax-clear-btn {
        background: #444;
        color: #ccc;
    }

    .spintax-char-count {
        color: #999;
    }

    .spintax-btn-secondary {
        background: #2a2a3d;
        color: #9fa8da;
        border-color: #555577;
    }

    .spintax-btn-secondary:hover:not(:disabled) {
        background: #333355;
        border-color: #7986cb;
    }

    .spintax-btn-secondary.spintax-copied {
        background: #1b3a1d;
        border-color: #4caf50;
        color: #81c784;
    }

    .spintax-divider {
        border-top-color: #3a3a5c;
    }

    .spintax-content h2 {
        color: #e0e0e0;
        border-bottom-color: #3a3a5c;
    }

    .spintax-content h3 {
        color: #9fa8da;
    }

    .spintax-example-box {
        background: #252540;
        border-left-color: #5c6bc0;
    }

    .spintax-code-block {
        background: #0d0d1a;
    }

    .spintax-warning-note {
        background: linear-gradient(135deg, #332d00 0%, #3d3500 100%);
        color: #ffe082;
        border-left-color: #ffc107;
    }

    .spintax-error-msg {
        background: #3d1515;
        color: #ef9a9a;
    }
}
