/**
 * INSTAGRÃO - Main Stylesheet
 * Design responsivo dark mode com suporte a AdSense
 * 
 * @author     CRuSHeR
 * @version    1.0.0
 * @package    INSTAGRÃO
 */

/* ============================================
   CSS VARIABLES (Dark Theme)
   ============================================ */
:root {
    /* Brand Colors - Instagram Gradient */
    --primary: #E1306C;
    --primary-dark: #C13584;
    --primary-light: #F56040;
    --secondary: #833AB4;
    --accent: #F77737;
    --gradient: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    --gradient-hover: linear-gradient(135deg, #bc1888 0%, #cc2366 25%, #dc2743 50%, #e6683c 75%, #f09433 100%);
    --gradient-soft: linear-gradient(135deg, rgba(225,48,108,0.2) 0%, rgba(131,58,180,0.2) 100%);
    
    /* Dark Theme Colors */
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #161616;
    --bg-card: #1a1a1a;
    --bg-card-hover: #222222;
    --bg-input: #1e1e1e;
    --bg-input-focus: #252525;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #707070;
    --text-disabled: #505050;
    
    /* Status Colors */
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);
    
    /* Borders & Shadows */
    --border-color: #2a2a2a;
    --border-color-light: #333333;
    --border-color-focus: var(--primary);
    --border-radius-sm: 8px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --border-radius-full: 9999px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(225, 48, 108, 0.3);
    
    /* Typography */
    --font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 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;
    --font-size-4xl: 2.5rem;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Layout */
    --header-height: 64px;
    --sidebar-width: 180px;
    --container-max: 1200px;
    --content-max: 800px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 250ms ease;
    --transition-slow: 400ms ease;
    
    /* Z-Index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 1000;
    --z-toast: 1100;
}

/* ============================================
   LIGHT MODE
   ============================================ */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #eeeeee;
    --bg-card: #ffffff;
    --bg-card-hover: #f9f9f9;
    --bg-input: #f5f5f5;
    --bg-input-focus: #ffffff;
    
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;
    --text-disabled: #aaaaaa;
    
    --border-color: #e0e0e0;
    --border-color-light: #eeeeee;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Theme Switch Toggle */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    margin-left: auto;
    margin-right: 1rem;
    cursor: pointer;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 30px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 2px solid var(--border-color);
    overflow: hidden;
}

.theme-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 2px;
    bottom: 2px;
    background: linear-gradient(135deg, #ffd93d, #ff9500);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 10px rgba(255, 217, 61, 0.5);
}

.theme-slider-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    transition: all 0.3s ease;
}

.theme-slider-icon.sun {
    left: 6px;
    opacity: 0;
    color: #ffd93d;
}

.theme-slider-icon.moon {
    right: 6px;
    opacity: 1;
    color: #a0a0c0;
}

/* Light mode - checked state */
.theme-switch input:checked + .theme-slider {
    background: linear-gradient(135deg, #87CEEB, #E0F6FF);
    border-color: #87CEEB;
}

.theme-switch input:checked + .theme-slider::before {
    transform: translateX(30px);
    background: linear-gradient(135deg, #ffd93d, #ffaa00);
    box-shadow: 0 2px 10px rgba(255, 170, 0, 0.6);
}

.theme-switch input:checked + .theme-slider .sun {
    opacity: 1;
}

.theme-switch input:checked + .theme-slider .moon {
    opacity: 0;
}

.theme-switch:hover .theme-slider {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(225, 48, 108, 0.3);
}

@media (max-width: 768px) {
    .theme-switch {
        width: 50px;
        height: 26px;
        margin-right: 0.5rem;
    }
    .theme-slider::before {
        width: 18px;
        height: 18px;
    }
    .theme-switch input:checked + .theme-slider::before {
        transform: translateX(24px);
    }
    .theme-slider-icon {
        font-size: 11px;
    }
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent);
}

img {
    max-width: 100%;
    height: auto;
}

ul {
    list-style: none;
}

/* ============================================
   Container
   ============================================ */
.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   Header
   ============================================ */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo:hover {
    color: var(--text-primary);
}

.logo-icon {
    font-size: 1.8rem;
}

.logo-highlight {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    padding: 60px 0 40px;
    text-align: center;
    background: radial-gradient(ellipse at center top, rgba(225, 48, 108, 0.1) 0%, transparent 50%);
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 35px;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   Download Box
   ============================================ */
.download-box {
    max-width: 650px;
    margin: 0 auto 35px;
}

.download-form {
    position: relative;
}

.input-wrapper {
    display: flex;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(225, 48, 108, 0.2);
}

.download-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 16px 22px;
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
}

.download-input::placeholder {
    color: var(--text-muted);
}

.download-btn {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 16px 28px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 130px;
    justify-content: center;
}

.download-btn:hover {
    background: var(--gradient-hover);
    transform: scale(1.02);
}

.download-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.download-btn.loading .btn-text {
    display: none;
}

.download-btn.loading .btn-loader {
    display: block;
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.input-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 10px;
}

/* ============================================
   Stats
   ============================================ */
.stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 30px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ============================================
   Main Wrapper with Sidebars
   ============================================ */
.main-wrapper {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
}

.main-content {
    flex: 1;
    min-width: 0;
}

/* ============================================
   Results Section
   ============================================ */
.results-section {
    padding: 30px 0;
}

.results-box {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    border: 1px solid var(--border-color);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
}

.result-thumbnail {
    width: 70px;
    height: 70px;
    border-radius: var(--border-radius);
    object-fit: cover;
}

.result-info h3 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.result-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.result-badge {
    display: inline-block;
    background: var(--gradient);
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 6px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.media-item {
    background: var(--bg-input);
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
}

.media-preview {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.media-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
}

.media-type {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: white;
    font-size: 0.75rem;
    margin-bottom: 8px;
}

.download-media-btn {
    width: 100%;
    background: var(--gradient);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.download-media-btn:hover {
    transform: scale(1.02);
}

/* ============================================
   Features Section
   ============================================ */
.features {
    padding: 60px 0;
    background: var(--bg-secondary);
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.feature-title {
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.feature-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================
   How To Section
   ============================================ */
.howto {
    padding: 60px 0;
}

.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.step {
    text-align: center;
    max-width: 220px;
}

.step-number {
    width: 55px;
    height: 55px;
    background: var(--gradient);
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.step-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.step-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.step-arrow {
    font-size: 1.8rem;
    color: var(--primary);
}

/* ============================================
   FAQ Section
   ============================================ */
.faq {
    padding: 60px 0;
    background: var(--bg-secondary);
}

.faq-list {
    max-width: 750px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 18px 22px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    color: var(--primary);
}

.faq-icon {
    font-size: 1.4rem;
    transition: var(--transition);
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 150px;
}

.faq-answer p {
    padding: 0 22px 18px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 50px 0 25px;
    margin-top: 40px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-brand p {
    width: 100%;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 5px;
}

.footer-links {
    display: flex;
    gap: 25px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

.footer-bottom p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.disclaimer {
    font-size: 0.75rem !important;
    color: var(--text-muted) !important;
    margin-top: 8px;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 14px 18px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
}

.alert-error {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #f87171;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--primary);
}

.modal-body {
    padding: 30px;
}

.modal-body h2 {
    margin-bottom: 20px;
    color: var(--primary);
}

.modal-body p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 0.9rem;
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 1200px) {
    .ad-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav.active {
        display: flex;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .hero-title {
        font-size: 1.9rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .input-wrapper {
        flex-direction: column;
    }
    
    .download-input {
        border-bottom: 1px solid var(--border-color);
    }
    
    .download-btn {
        border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    }
    
    .stats {
        gap: 25px;
    }
    
    .stat-number {
        font-size: 1.4rem;
    }
    
    .steps {
        flex-direction: column;
    }
    
    .step-arrow {
        transform: rotate(90deg);
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-brand {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 40px 0 30px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .media-grid {
        grid-template-columns: 1fr;
    }
}
