/* =====================================================
   SOCIAL PACK PRO - LIGHT THEME (Consistent with Site)
   ===================================================== */

:root {
    --bg: #f8fafc;
    --bg-white: #ffffff;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: rgba(37, 99, 235, 0.08);
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.08);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* =====================================================
   HEADER - Universal Styles
   ===================================================== */
.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header__inner { display: flex; align-items: center; justify-content: space-between; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.back-btn { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: #f5f5f5; border-radius: 10px; color: #333; margin-right: 12px; transition: all 0.2s; text-decoration: none; }
.back-btn:hover { background: #333; color: white; }
.back-btn svg { width: 20px; height: 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; text-decoration: none; color: inherit; }
.logo__icon { width: 28px; height: 28px; color: #1a1a1a; }
.logo__text { color: var(--text); }
.nav { display: flex; gap: 4px; }
.nav__link { padding: 8px 14px; font-size: 14px; font-weight: 500; color: var(--text-secondary); border-radius: 6px; transition: all 0.2s; text-decoration: none; }
.nav__link:hover { color: var(--text); background: var(--bg); }
.nav__link--active { color: var(--primary); background: var(--primary-light); }

/* =====================================================
   UPLOAD PAGE
   ===================================================== */
.upload-section {
    max-width: 600px;
    margin: 0 auto;
    padding: 60px 20px;
    text-align: center;
}

.upload-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.upload-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.platform-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.platform-pill {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.platform-pill.instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743); }
.platform-pill.facebook { background: #1877f2; }
.platform-pill.youtube { background: #ff0000; }
.platform-pill.twitter { background: #000; }
.platform-pill.linkedin { background: #0a66c2; }
.platform-pill.whatsapp { background: #25d366; }

.upload-zone {
    padding: 50px 30px;
    background: var(--bg-white);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-icon {
    margin-bottom: 16px;
    color: var(--primary);
}

.upload-zone h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.upload-zone p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.upload-hint {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

/* =====================================================
   EDITOR SECTION
   ===================================================== */
.editor-section {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 20px;
}

.source-panel {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 80px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.panel-header h3 {
    font-size: 14px;
    font-weight: 600;
}

.btn-change {
    padding: 6px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    transition: all 0.2s;
}

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

.source-preview {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg);
}

.source-preview img {
    width: 100%;
    height: auto;
}

.source-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: white;
}

/* Focal Point */
.focal-point-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.focal-point-section h4 {
    font-size: 13px;
    margin-bottom: 6px;
}

.focal-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.focal-preview-container {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg);
}

.focal-preview {
    position: relative;
    cursor: crosshair;
}

.focal-preview img {
    width: 100%;
    height: auto;
}

.focal-marker {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid var(--primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.btn-reset-focal {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    transition: all 0.2s;
}

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

/* Platforms Panel */
.platforms-panel {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.select-actions {
    display: flex;
    gap: 8px;
}

.btn-select-all,
.btn-deselect-all {
    padding: 6px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 11px;
    transition: all 0.2s;
}

.btn-select-all:hover,
.btn-deselect-all:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Platform Groups */
.platform-groups {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.platform-group {
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
}

.group-icon { font-size: 18px; }

.group-name {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
}

.group-count {
    font-size: 11px;
    color: var(--text-muted);
}

.group-sizes { padding: 8px; }

.size-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.size-option:hover {
    background: var(--bg-white);
}

.size-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.size-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.size-name {
    font-size: 13px;
    font-weight: 500;
}

.size-dims {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

.size-preview {
    width: 28px;
    height: 28px;
    background: var(--border);
    border-radius: 4px;
}

.size-preview.square { aspect-ratio: 1; }
.size-preview.portrait { width: 20px; height: 25px; }
.size-preview.story { width: 15px; height: 28px; }
.size-preview.landscape { width: 32px; height: 18px; }
.size-preview.cover { width: 36px; height: 14px; }
.size-preview.thumbnail { width: 30px; height: 17px; }
.size-preview.banner { width: 40px; height: 10px; }
.size-preview.header { width: 40px; height: 14px; }
.size-preview.small { width: 18px; height: 18px; }

/* Generate Section */
.generate-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.selected-count {
    font-size: 14px;
    color: var(--text-secondary);
}

.selected-count span {
    font-weight: 700;
    color: var(--primary);
}

.btn-generate {
    padding: 14px 32px;
    background: var(--primary);
    border-radius: var(--radius);
    color: white;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-generate:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-generate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    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); }
}

/* =====================================================
   RESULTS SECTION
   ===================================================== */
.results-section {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 20px 60px;
}

.results-header {
    text-align: center;
    margin-bottom: 24px;
}

.results-header h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.results-header p {
    color: var(--text-secondary);
}

.results-header span {
    color: var(--primary);
    font-weight: 600;
}

/* Download All */
.download-all-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.btn-download-all {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: var(--success);
    border-radius: var(--radius);
    color: white;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-download-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.zip-size {
    font-size: 13px;
    color: var(--text-muted);
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.result-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.result-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.result-preview {
    position: relative;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    padding: 12px;
}

.result-preview img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
    border-radius: 4px;
}

.result-platform {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    background: rgba(0,0,0,0.7);
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    color: white;
}

.result-info {
    padding: 12px;
    border-top: 1px solid var(--border);
}

.result-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-dims {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

.result-download {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
}

.result-download:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Results Actions */
.results-actions {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.btn-start-over {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.2s;
}

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

/* Share Prompt */
.share-prompt {
    margin-top: 40px;
    padding: 24px;
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    text-align: center;
}

.share-prompt p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.share-btn.twitter {
    background: #000;
    color: white;
}

.share-btn.twitter:hover {
    background: #333;
}

.share-btn.copy {
    background: var(--bg-white);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

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

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
    padding: 24px 20px;
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--bg-white);
    margin-top: auto;
}

.footer p {
    color: var(--text-muted);
    font-size: 13px;
}

.footer-tagline {
    margin-top: 4px;
    font-size: 12px;
}

/* =====================================================
   VIRAL NOTIFICATIONS
   ===================================================== */
.viral-notification {
    position: fixed;
    top: 100px;
    right: -400px;
    z-index: 9999;
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transition: all 0.4s ease;
    max-width: 350px;
    cursor: pointer;
}

.viral-notification.show {
    right: 20px;
}

.viral-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.viral-icon {
    font-size: 18px;
    animation: pulse 2s infinite;
}

.viral-text strong {
    font-weight: 700;
}

.viral-close {
    margin-left: auto;
    font-size: 16px;
    opacity: 0.7;
    cursor: pointer;
    padding: 0 4px;
}

.viral-close:hover {
    opacity: 1;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Speed Badge */
.speed-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1000;
}

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

.toast-icon {
    width: 22px;
    height: 22px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.toast-message {
    font-size: 14px;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .editor-section {
        grid-template-columns: 1fr;
    }
    
    .source-panel {
        position: static;
    }
    
    .platform-groups {
        grid-template-columns: 1fr;
    }
    
    .header-stats {
        display: none;
    }
    
    .upload-title {
        font-size: 28px;
    }
    
    .generate-section {
        flex-direction: column;
        text-align: center;
    }
    
    .btn-generate {
        width: 100%;
    }
    
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .upload-section {
        padding: 40px 16px;
    }
    
    .upload-title {
        font-size: 24px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .share-buttons {
        flex-direction: column;
    }
}
