/* ===================================
   GiraCSS - Estilos Principais
   =================================== */

:root {
    --color-primary: #6366f1;
    --color-secondary: #8b5cf6;
    --color-success: #10b981;
    --color-info: #3b82f6;
    --color-danger: #ef4444;
    --color-dark: #1e1b4b;
    --color-darker: #0f172a;
    --color-light: #f1f5f9;
    --color-border: #334155;
    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--color-darker) 0%, var(--color-dark) 100%);
    color: var(--color-text);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ===================================
   Header
   =================================== */

.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-icon {
    font-size: 48px;
    animation: spin 3s linear infinite;
    display: inline-block;
    transform-origin: center;
}

.logo-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    transform-origin: center;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.header h1 {
    font-size: 48px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header h1 .suite-text {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: #e6eaf2;
    background-clip: unset;
    color: #e6eaf2;
}

.subtitle {
    font-size: 18px;
    color: var(--color-text-muted);
    margin-top: 10px;
}

.btn-back {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(99, 102, 241, 0.2);
    color: var(--color-text);
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
}

.btn-back:hover {
    background: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ===================================
   Main Content
   =================================== */

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   Sections
   =================================== */

.input-section,
.output-section {
    background: rgba(30, 27, 75, 0.5);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    font-size: 24px;
    color: var(--color-text);
}

/* ===================================
   Textarea
   =================================== */

.code-textarea {
    width: 100%;
    min-height: 400px;
    padding: 20px;
    background: var(--color-darker);
    border: 2px solid var(--color-border);
    border-radius: 12px;
    color: var(--color-text);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s ease;
}

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

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

/* ===================================
   Buttons
   =================================== */

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

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

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
}

.btn-secondary {
    background: var(--color-border);
    color: var(--color-text);
}

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

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

.btn-upload {
    padding: 10px 20px;
    background: var(--color-secondary);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

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

/* Format Toggle Buttons */
.format-toggle {
    display: flex;
    gap: 10px;
}

.format-btn {
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.2);
    color: var(--color-text);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
}

.format-btn:hover {
    background: rgba(99, 102, 241, 0.3);
}

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

/* ===================================
   Stats
   =================================== */

.stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 14px;
}

.stat-item {
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.stat-item.reduction {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--color-success);
}

/* ===================================
   Loading Overlay
   =================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-overlay p {
    margin-top: 20px;
    font-size: 18px;
    color: var(--color-text);
}

/* ===================================
   Footer
   =================================== */

.footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 80px;
    background: rgba(30, 27, 75, 0.5);
    border-top: 2px solid var(--color-border);
    border-radius: 16px 16px 0 0;
}

.footer p {
    font-size: 16px;
    color: var(--color-text);
    margin: 0;
    line-height: 1.8;
}

.footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 5px 10px;
    border-radius: 6px;
}

.footer a:hover {
    color: var(--color-secondary);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

/* ===================================
   Responsive
   =================================== */

@media (max-width: 768px) {
    .header h1 {
        font-size: 36px;
    }
    
    .logo-icon {
        font-size: 36px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
