/**
 * Gerador de Gradiente CSS
 * Desenvolvido por B20 Conteúdo Digital
 * https://www.b20.com.br
 * Todos os direitos reservados
 */

/* ========================================
   CSS CUSTOM PROPERTIES
   ======================================== */
:root {
    /* Color Palette */
    --color-primary: #833AB4;
    --color-secondary: #FD1D1D;
    --color-accent-1: #F77737;
    --color-accent-2: #FCAF45;
    --color-accent-3: #FFDC80;
    
    /* Neutral Colors */
    --color-bg: #0f0f1e;
    --color-surface: #1a1a2e;
    --color-surface-light: #252541;
    --color-text: #ffffff;
    --color-text-secondary: #b8b8d1;
    --color-border: #2d2d44;
    
    /* Semantic Colors */
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --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-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 120px;
    padding-bottom: 110px;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ========================================
   LAYOUT
   ======================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

main {
    flex: 1;
    padding: calc(var(--spacing-xl) + 40px) 0 var(--spacing-xl);
}

/* ========================================
   HEADER
   ======================================== */
.app-header {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    padding: var(--spacing-xs) 0;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 300;
    min-height: 48px;
}
.black-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 30px;
background-color: #000000;
z-index: 1001;
}
.app-header__content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.app-logo {
    width: 36px;
    max-width: none;
    height: auto;
    display: block;
}

.app-header__text {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: var(--spacing-sm);
}

.app-header__text h1,
.app-header__text .subtitle {
    margin: 0;
}

.app-header__text h1 {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.subtitle {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.subtitle::before {
    content: '•';
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ========================================
   SECTIONS
   ======================================== */
section {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

section h2 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-lg);
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* ========================================
   PREVIEW SECTION
   ======================================== */
.gradient-preview {
    width: 100%;
    height: 300px;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    transition: all var(--transition-base);
}

.preview-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    opacity: 1;
    transition: opacity var(--transition-base);
}

.gradient-preview.has-gradient .preview-overlay {
    opacity: 0;
    pointer-events: none;
}

.preview-text {
    color: white;
    font-size: var(--font-size-lg);
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ========================================
   CONTROLS
   ======================================== */
.control-group {
    margin-bottom: var(--spacing-lg);
}

.control-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text);
    font-size: var(--font-size-base);
}

.label-icon {
    font-size: var(--font-size-xl);
}

.control-select {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--color-surface-light);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.control-select:hover {
    border-color: var(--color-primary);
}

.control-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(131, 58, 180, 0.1);
}

/* ========================================
   BUTTON GROUP
   ======================================== */
.button-group {
    display: flex;
    gap: var(--spacing-sm);
}

.btn-toggle {
    flex: 1;
    padding: var(--spacing-md);
    background: var(--color-surface-light);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

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

/* ========================================
   COLORS LIST
   ======================================== */
.colors-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.color-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--color-surface-light);
    border-radius: var(--radius-md);
    border: 2px solid var(--color-border);
    transition: all var(--transition-fast);
}

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

.color-input-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 3px solid var(--color-border);
    transition: all var(--transition-fast);
}

.color-input-wrapper:hover {
    transform: scale(1.05);
    border-color: var(--color-primary);
}

.color-input {
    position: absolute;
    inset: -10px;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    border: none;
    cursor: pointer;
}

.color-value {
    flex: 1;
    padding: var(--spacing-md);
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: var(--font-size-base);
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
}

.color-value:focus {
    border-color: var(--color-primary);
    outline: none;
}

.btn-remove-color {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-error);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: var(--font-size-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 44px;
    min-height: 44px;
}

.btn-remove-color:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.btn-add-color {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.btn-add-color:hover {
    background: #6d2d99;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   PRESET COLORS
   ======================================== */
.preset-colors {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.preset-color {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    border: 3px solid var(--color-border);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.preset-color:hover {
    transform: scale(1.15);
    border-color: white;
    box-shadow: var(--shadow-lg);
}

.preset-color:active {
    transform: scale(1.05);
}

/* ========================================
   CODE SECTION
   ======================================== */
.code-container {
    position: relative;
}

.css-code {
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: var(--font-size-sm);
    line-height: 1.8;
    color: var(--color-accent-3);
    margin-bottom: var(--spacing-md);
}

.css-code code {
    color: var(--color-accent-3);
}

.btn-copy {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--color-success);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.btn-copy:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.copy-feedback {
    padding: var(--spacing-md);
    background: var(--color-success);
    color: white;
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 600;
    margin-top: var(--spacing-md);
    animation: slideIn var(--transition-base);
}

/* ========================================
   HISTORY SECTION
   ======================================== */
.history-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--spacing-sm);
}

.history-item {
    aspect-ratio: 1 / 1;
    min-height: 0;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 3px solid var(--color-border);
    position: relative;
    overflow: hidden;
}

.history-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--color-primary);
}

.history-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.history-item:hover .history-item-overlay {
    opacity: 1;
}

.history-item-text {
    color: white;
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-align: center;
    padding: var(--spacing-sm);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--color-text-secondary);
    font-size: var(--font-size-lg);
}

/* ========================================
   FAQ SECTION
   ======================================== */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.faq-item {
    background: var(--color-surface-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--color-border);
    transition: all var(--transition-fast);
}

.faq-item:hover {
    border-color: var(--color-primary);
}

.faq-question {
    width: 100%;
    padding: var(--spacing-lg);
    background: transparent;
    border: none;
    color: var(--color-text);
    font-size: var(--font-size-base);
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    transition: all var(--transition-fast);
}

.faq-question:hover {
    background: var(--color-border);
}

.faq-icon {
    font-size: var(--font-size-2xl);
    font-weight: 300;
    transition: transform var(--transition-fast);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 var(--spacing-lg);
    max-height: 0;
    overflow: hidden;
    transition: all var(--transition-base);
}

.faq-answer:not([hidden]) {
    padding: var(--spacing-lg);
    max-height: 500px;
}

.faq-answer p {
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.faq-answer code {
    background: var(--color-bg);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    color: var(--color-accent-2);
}

/* ========================================
   FOOTER
   ======================================== */
.app-footer {
    background: var(--color-surface);
    padding: var(--spacing-xl) 0;
    text-align: center;
    border-top: 2px solid var(--color-border);
    margin-top: auto;
}

.app-footer p {
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-secondary);
}

.b20-link {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.b20-link:hover {
    text-decoration: underline;
    transform: scale(1.05);
    display: inline-block;
}

/* ========================================
   TOAST NOTIFICATION
   ======================================== */
.toast {
    position: fixed;
    bottom: var(--spacing-xl);
    right: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--color-surface);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-weight: 600;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    animation: slideInRight var(--transition-base);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.hidden {
    display: none !important;
}

/* ========================================
   BOTTOM NAVIGATION
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: var(--spacing-md);
    left: 50%;
    transform: translateX(-50%);
    width: min(520px, calc(100% - (var(--spacing-md) * 2)));
    background: rgba(26, 26, 46, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    z-index: 200;
    backdrop-filter: blur(12px);
}

.bottom-nav__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.bottom-nav__icon {
    font-size: 1.15rem;
    line-height: 1;
}

.bottom-nav__icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bottom-nav__link--active {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    box-shadow: var(--shadow-md);
}

.bottom-nav__link:hover {
    color: white;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    :root {
        --font-size-3xl: 1.75rem;
        --font-size-2xl: 1.25rem;
    }
    
    body {
        padding-top: 150px;
    }
    
    .app-logo {
        width: 42px;
    }
    
    .app-header__content {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-xs);
    }
    
    .app-header__text {
        flex-direction: column;
        text-align: center;
    }
    
    section {
        padding: var(--spacing-lg);
    }
    
    main {
        padding-top: calc(var(--spacing-xl) + 70px);
    }
    
    .gradient-preview {
        height: 200px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .color-item {
        flex-wrap: wrap;
    }
    
    .history-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    
    .toast {
        left: var(--spacing-md);
        right: var(--spacing-md);
        bottom: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .bottom-nav {
        width: 100%;
        left: 0;
        transform: none;
        border-radius: 0;
        bottom: 0;
        border-left: none;
        border-right: none;
    }
    
    .bottom-nav__link {
        padding: var(--spacing-sm) var(--spacing-xs);
    }
    body {
        padding-top: 170px;
    }
    
    .preset-colors {
        justify-content: center;
    }
    
    main {
        padding-top: calc(var(--spacing-xl) + 90px);
    }
    
    .app-logo {
        width: 38px;
    }
    
    .preset-color {
        width: 44px;
        height: 44px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .controls-section,
    .app-footer,
    .btn-copy,
    .toast {
        display: none;
    }
    
    .gradient-preview {
        page-break-inside: avoid;
    }
}
