/**
 * ConvMaster - 80x15 Button Generator Styles
 * 
 * @package    ConvMaster
 * @version    1.0.0
 */

/* =====================================================
   TOOL PAGE LAYOUT
   ===================================================== */
.tool-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tool-header__icon {
    font-size: 2.5rem;
}

.tool-header__icon .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
}

.tool-header__icon .icon--purple {
    background: rgba(139, 92, 246, 0.15);
}

.tool-header__text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--text-primary);
}

.tool-header__text p {
    margin: 0;
    color: var(--text-secondary);
}

/* =====================================================
   BUTTON GENERATOR WIDGET
   ===================================================== */
.button-generator {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* =====================================================
   MODE SELECTOR
   ===================================================== */
.button-generator__mode-selector {
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.mode-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mode-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.mode-tab:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.mode-tab--active {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.mode-tab__icon {
    font-size: 1.1rem;
}

.mode-tab__label {
    font-weight: 600;
}

/* =====================================================
   PREVIEW AREA
   ===================================================== */
.button-generator__preview-area {
    padding: 2rem 1.5rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.preview-header__icon {
    font-size: 1.25rem;
}

.preview-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.preview-canvas-wrapper {
    background: repeating-conic-gradient(#e0e0e0 0% 25%, #fff 0% 50%) 50% / 16px 16px;
    padding: 1.5rem 2rem;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
}

[data-theme="dark"] .preview-canvas-wrapper {
    background: repeating-conic-gradient(#3a3a3a 0% 25%, #2a2a2a 0% 50%) 50% / 16px 16px;
}

.preview-canvas-wrapper canvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.preview-zoom {
    position: relative;
    background: repeating-conic-gradient(#e0e0e0 0% 25%, #fff 0% 50%) 50% / 16px 16px;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .preview-zoom {
    background: repeating-conic-gradient(#3a3a3a 0% 25%, #2a2a2a 0% 50%) 50% / 16px 16px;
}

.preview-zoom canvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.preview-zoom__label {
    position: absolute;
    top: 0.25rem;
    right: 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
}

.preview-formats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.format-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    letter-spacing: 0.5px;
}

.format-badge--png {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.format-badge--size {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

.preview-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* =====================================================
   WORKSPACE LAYOUT
   ===================================================== */
.button-generator__workspace {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.5rem;
}

@media (max-width: 700px) {
    .button-generator__workspace {
        grid-template-columns: 1fr;
    }
}

.button-generator__section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.button-generator__section--presets {
    grid-column: 1 / -1;
}

.button-generator__section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.button-generator__step-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 50%;
}

.button-generator__section-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* =====================================================
   FORM STYLES
   ===================================================== */
.button-form__group {
    margin-bottom: 1rem;
}

.button-form__group:last-child {
    margin-bottom: 0;
}

.button-form__group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.button-form__input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.button-form__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.button-form__input::placeholder {
    color: var(--text-muted);
}

.button-form__input--small {
    width: 90px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-family: monospace;
}

.button-form__unit {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

/* =====================================================
   OPTIONS ROW
   ===================================================== */
.button-options__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 500px) {
    .button-options__row {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   COLOR PICKER
   ===================================================== */
.button-color-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.button-color-picker input[type="color"] {
    width: 40px;
    height: 36px;
    padding: 2px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
}

.button-color-picker input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.button-color-picker input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

.button-color-picker input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 2px;
}

/* =====================================================
   SLIDER
   ===================================================== */
.button-slider-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.button-form__slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.button-form__slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: transform 0.1s ease;
}

.button-form__slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.button-form__slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

.button-slider-value {
    min-width: 28px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

/* =====================================================
   FULL WIDTH SECTIONS
   ===================================================== */
.button-generator__section--full-width {
    grid-column: 1 / -1;
}

/* =====================================================
   ALIGN BUTTONS
   ===================================================== */
.button-align-group {
    display: flex;
    gap: 0.5rem;
}

.align-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 36px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.align-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.align-btn--active {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

/* =====================================================
   POSITION BUTTONS
   ===================================================== */
.button-position-group {
    display: flex;
    gap: 0.5rem;
}

.position-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
}

.position-btn:hover {
    border-color: var(--primary);
}

.position-btn--active {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

/* =====================================================
   LOGO UPLOAD
   ===================================================== */
.logo-upload-area {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
}

.logo-upload-area:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.logo-upload-area.dragover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.logo-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.logo-upload-icon {
    font-size: 1.5rem;
}

.logo-upload-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.logo-preview {
    position: relative;
    display: inline-block;
}

.logo-preview img {
    max-height: 40px;
    max-width: 60px;
    image-rendering: pixelated;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: repeating-conic-gradient(#e0e0e0 0% 25%, #fff 0% 50%) 50% / 8px 8px;
}

[data-theme="dark"] .logo-preview img {
    background: repeating-conic-gradient(#3a3a3a 0% 25%, #2a2a2a 0% 50%) 50% / 8px 8px;
}

.logo-remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease;
}

.logo-remove-btn:hover {
    transform: scale(1.1);
}

/* =====================================================
   CONTENT TOGGLE (Text/Image)
   ===================================================== */
.content-toggle {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-secondary);
    padding: 0.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.content-toggle__btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.content-toggle__btn:hover {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.05);
}

.content-toggle__btn--active {
    background: var(--primary);
    color: white;
}

.content-toggle__btn--active:hover {
    background: var(--primary-dark);
    color: white;
}

.content-toggle__btn span {
    font-size: 0.9rem;
}

/* =====================================================
   ZONE UPLOAD (for split mode left/right)
   ===================================================== */
.zone-upload-area {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zone-upload-area:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.zone-upload-area.dragover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.zone-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.zone-upload-icon {
    font-size: 1.25rem;
}

.zone-upload-text {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.zone-image-preview {
    position: relative;
    display: inline-block;
}

.zone-image-preview img {
    max-height: 36px;
    max-width: 50px;
    image-rendering: pixelated;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: repeating-conic-gradient(#e0e0e0 0% 25%, #fff 0% 50%) 50% / 8px 8px;
}

[data-theme="dark"] .zone-image-preview img {
    background: repeating-conic-gradient(#3a3a3a 0% 25%, #2a2a2a 0% 50%) 50% / 8px 8px;
}

.zone-remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease;
}

.zone-remove-btn:hover {
    transform: scale(1.1);
}

/* =====================================================
   PRESETS
   ===================================================== */
.presets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.preset-btn {
    padding: 0.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.preset-preview {
    display: block;
    width: 80px;
    height: 15px;
    border-radius: 1px;
    image-rendering: pixelated;
}

/* Preset previews using CSS gradients */
.preset-preview--default {
    background: linear-gradient(to right, #5865F2 50%, #CCCCCC 50%);
    border: 1px solid #000;
}

.preset-preview--github {
    background: linear-gradient(to right, #24292e 50%, #f6f8fa 50%);
    border: 1px solid #1b1f23;
}

.preset-preview--discord {
    background: linear-gradient(to right, #5865F2 50%, #23272A 50%);
    border: 1px solid #000;
}

.preset-preview--html5 {
    background: linear-gradient(to right, #E44D26 50%, #F16529 50%);
    border: 1px solid #000;
}

.preset-preview--css3 {
    background: linear-gradient(to right, #264de4 50%, #2965f1 50%);
    border: 1px solid #000;
}

.preset-preview--php {
    background: linear-gradient(to right, #777BB4 50%, #4F5D95 50%);
    border: 1px solid #000;
}

.preset-preview--retro {
    background: linear-gradient(to right, #008080 50%, #C0C0C0 50%);
    border: 1px solid #000;
}

.preset-preview--neon {
    background: linear-gradient(to right, #ff00ff 50%, #00ffff 50%);
    border: 1px solid #000;
}

/* =====================================================
   ACTION BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn--primary {
    background: var(--primary);
    color: white;
}

.btn--primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn--secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn--secondary:hover {
    background: var(--bg-secondary);
}

.btn svg {
    flex-shrink: 0;
}

/* =====================================================
   INFO BAR
   ===================================================== */
.button-generator__info {
    text-align: center;
    padding: 1rem 1.5rem;
    background: rgba(16, 185, 129, 0.1);
    border-top: 1px solid var(--border-color);
}

.button-generator__info p {
    font-size: 0.8rem;
    color: var(--success);
    margin: 0;
}

/* =====================================================
   SEO CONTENT
   ===================================================== */
.tool-content {
    margin-top: 3rem;
}

.tool-section {
    margin-bottom: 2.5rem;
}

.tool-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.tool-section p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
}

.feature-card__icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.step-card__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 0.75rem;
}

.step-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.step-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

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

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.faq-item summary {
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--text-muted);
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item p {
    padding: 0 1.5rem 1rem;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* =====================================================
   HIDDEN ELEMENTS
   ===================================================== */
[hidden] {
    display: none !important;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 640px) {
    .button-generator__preview-area {
        padding: 1.5rem 1rem;
    }
    
    .button-generator__workspace {
        padding: 1rem;
    }
    
    .preview-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .preview-actions .btn {
        width: 100%;
    }
}

/* =====================================================
   LIGHT THEME ADJUSTMENTS
   ===================================================== */
[data-theme="light"] .button-form__input {
    background: var(--bg-primary);
}

[data-theme="light"] .button-generator__section {
    background: var(--bg-secondary);
}

[data-theme="light"] .button-generator__preview-area {
    background: var(--bg-secondary);
}

[data-theme="light"] .button-form__slider {
    background: var(--border-color);
}

[data-theme="light"] .preset-btn {
    background: var(--bg-primary);
}
