/* ============================================
   Twitter Font Generator
   Dark Mode Support with Light Mode Default
   Blue Theme for Social Media Tools
   ============================================ */

/* CSS Variables - Light Mode (Default) */
:root {
    --transition-speed: 0.25s;

    /* Primary Colors - Blue Theme */
    --primary: #3399cc;
    --primary-light: #e0f2fe;
    --primary-dark: #2980b9;
    --accent: #60a5fa;

    /* Status Colors */
    --success: #339966;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #e64e4e;
    --danger-light: #fee2e2;

    /* Background Colors */
    --bg: #f0f9ff;
    --bg-elevated: #ffffff;
    --bg-secondary: #e0f2fe;
    --bg-tertiary: #bae6fd;

    /* Text Colors */
    --text: #0c4a6e;
    --text-secondary: #075985;
    --text-muted: #6b7280;

    /* Border Colors */
    --border: #bae6fd;
    --border-light: #e0f2fe;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-primary: 0 4px 14px rgba(51, 153, 204, 0.25);
    --shadow-primary-hover: 0 6px 20px rgba(51, 153, 204, 0.35);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Input */
    --input-bg: #ffffff;
    --input-border: #bae6fd;
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --primary: #60a5fa;
    --primary-light: rgba(96, 165, 250, 0.15);
    --primary-dark: #3b82f6;
    --accent: #93c5fd;

    --success: #34d399;
    --success-light: rgba(52, 211, 153, 0.15);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.15);

    --bg: #0c1929;
    --bg-elevated: #152238;
    --bg-secondary: #1e3a5f;
    --bg-tertiary: #264a6e;

    --text: #e0f2fe;
    --text-secondary: #bae6fd;
    --text-muted: #a8a8b3;

    --border: #264a6e;
    --border-light: #1e3a5f;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);
    --shadow-primary: 0 4px 14px rgba(96, 165, 250, 0.2);
    --shadow-primary-hover: 0 6px 20px rgba(96, 165, 250, 0.3);

    --input-bg: #1e3a5f;
    --input-border: #264a6e;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Fix custom_styles.css clipping */
.tool-main {
    overflow: visible !important;
}

/* Container */
.tool-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tool-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 0 0 0.75rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.tool-title i,
.tool-title svg {
    color: var(--primary);
}

.tool-description {
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.tool-description a {
    color: var(--primary);
    text-decoration: none;
}

.tool-description a:hover {
    text-decoration: underline;
}

/* ============================================
   Input Section
   ============================================ */
.tfg-input-section {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.tfg-input-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text);
    font-weight: 600;
    font-size: 1.1rem;
}

.tfg-input-header i,
.tfg-input-header svg {
    color: var(--primary);
}

.tfg-textarea-wrapper {
    position: relative;
    margin-bottom: 0.75rem;
}

.tfg-textarea {
    display: block;
    width: 100%;
    min-width: 0;
    resize: vertical;
    min-height: 90px;
    padding: 0.875rem 1rem 2.5rem;
    border: 2px solid var(--input-border);
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-family: inherit;
    line-height: 1.5;
    background: var(--input-bg);
    color: var(--text);
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.tfg-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.tfg-textarea::placeholder {
    color: var(--text-muted);
}

.tfg-textarea-tools {
    position: absolute;
    bottom: 8px;
    right: 8px;
    left: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    pointer-events: none;
}

.tfg-char-count {
    margin-right: auto;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.tfg-mini-btn {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--transition-speed);
}

.tfg-mini-btn:hover {
    background: var(--bg-tertiary);
}

.tfg-mini-btn svg {
    color: var(--primary);
}

.tfg-input-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.tfg-hint-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tfg-hint-item svg {
    color: var(--primary);
    flex-shrink: 0;
}

/* Filter */
.tfg-filter-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.tfg-filter-wrapper svg {
    color: var(--primary);
    flex-shrink: 0;
}

.tfg-filter-input {
    flex: 1 1 0%;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    color: var(--text);
    padding: 0.25rem 0;
}

.tfg-filter-input:focus {
    outline: none;
}

.tfg-filter-input::placeholder {
    color: var(--text-muted);
}

/* ============================================
   Styles List
   ============================================ */
.tfg-styles-section {
    margin-bottom: 1.5rem;
}

.tfg-styles-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tfg-style-row {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.25rem;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.tfg-style-row:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.tfg-style-row.tfg-row-copied {
    border-color: var(--success);
    box-shadow: 0 0 0 3px var(--success-light);
}

.tfg-style-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.4rem;
}

.tfg-style-name {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.tfg-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition-speed), border-color var(--transition-speed), color var(--transition-speed);
}

.tfg-copy-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.tfg-copy-btn:hover svg {
    color: #ffffff;
}

.tfg-copy-btn svg {
    color: var(--primary);
}

.tfg-style-output {
    font-size: 1.3rem;
    line-height: 1.5;
    color: var(--text);
    cursor: pointer;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.tfg-style-output.tfg-sample {
    color: var(--text-muted);
}

.tfg-style-output:hover {
    color: var(--primary);
}

.tfg-no-results {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 2.5rem 1.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
}

.tfg-no-results svg {
    color: var(--primary);
    flex-shrink: 0;
}

/* ============================================
   Toast
   ============================================ */
.tfg-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.3rem;
    background: var(--success);
    color: #ffffff;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: opacity var(--transition-speed), transform var(--transition-speed);
    z-index: 9000;
}

.tfg-toast.tfg-toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.tfg-toast svg {
    color: #ffffff;
}

/* ============================================
   Related Tools
   ============================================ */
.tfg-related-tools {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem 1rem;
}

.tfg-related-tools-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
}

.tfg-related-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.tfg-related-label svg {
    color: var(--primary);
}

.tfg-related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tfg-related-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background var(--transition-speed), border-color var(--transition-speed), color var(--transition-speed);
}

.tfg-related-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.tfg-related-link svg {
    color: var(--primary);
}

/* ============================================
   Info Sections
   ============================================ */
.tfg-info-sections {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
}

.tfg-info-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.tfg-info-card h2 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 1rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
}

.tfg-info-card h2 svg {
    color: var(--primary);
    flex-shrink: 0;
}

.tfg-info-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0.75rem 0;
}

.tfg-info-card a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.tfg-info-card a:hover {
    text-decoration: underline;
}

.tfg-steps-list {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.tfg-steps-list li {
    margin-bottom: 0.6rem;
}

.tfg-steps-list strong {
    color: var(--text);
}

/* Format / explanation grid */
.tfg-format-list,
.tfg-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}

.tfg-format-list > *,
.tfg-features-grid > * {
    min-width: 0;
}

.tfg-format-item,
.tfg-feature-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.1rem;
}

.tfg-format-item svg,
.tfg-feature-item svg {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.tfg-format-item h4,
.tfg-feature-item h4 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.tfg-format-item p,
.tfg-feature-item p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* FAQ */
.tfg-faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.tfg-faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-secondary);
}

.tfg-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.25rem;
    background: transparent;
    border: none;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
}

.tfg-faq-question svg {
    flex-shrink: 0;
    color: var(--primary);
    transition: transform var(--transition-speed);
}

.tfg-faq-item.active .tfg-faq-question svg {
    transform: rotate(180deg);
}

.tfg-faq-answer {
    display: none;
    padding: 0 1.25rem 1rem;
}

.tfg-faq-item.active .tfg-faq-answer {
    display: block;
}

.tfg-faq-answer p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
    .tool-container {
        padding: 1.25rem;
    }

    .tfg-related-tools,
    .tfg-info-sections {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .tfg-input-section,
    .tfg-info-card {
        padding: 1.25rem;
    }

    .tool-title {
        font-size: 1.4rem;
    }

    .tfg-style-output {
        font-size: 1.15rem;
    }
}
