/**
 * ╔═══════════════════════════════════════════════════════════════════════════╗
 * ║                         Xaper.io - Core Styles                            ║
 * ╠═══════════════════════════════════════════════════════════════════════════╣
 * ║  Ustvarjeno:  2025-01-30                                                  ║
 * ║  Accent:      Modra (#3b82f6)                                             ║
 * ╚═══════════════════════════════════════════════════════════════════════════╝
 */


/* ═══════════════════════════════════════════════════════════════════════════
   1. CSS SPREMENLJIVKE
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* Barve ozadja */
    --bg-primary: #0a0a0b;
    --bg-secondary: #111113;
    --bg-tertiary: #1a1a1d;
    
    /* Barve besedila */
    --text: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    /* Poudarki - modra */
    --accent: #3b82f6;
    --accent-dim: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.3);
    
    /* Obrobe */
    --border: #27272a;
    
    /* Stanja */
    --success: #22c55e;
    --success-glow: rgba(34, 197, 94, 0.3);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.3);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.3);
    
    /* Prehodi */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    
    /* Zaokroženja */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   2. RESET
   ═══════════════════════════════════════════════════════════════════════════ */

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

html, body {
    height: 100%;
}


/* ═══════════════════════════════════════════════════════════════════════════
   3. BODY & NOISE OVERLAY
   ═══════════════════════════════════════════════════════════════════════════ */

body {
    font-family: 'Play', sans-serif;
    background: var(--bg-primary);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    margin: 0;
    overflow-x: hidden;
    overflow-y: scroll;
}

main {
    flex: 1;
    padding-top: 32px;
}

/* Noise overlay - subtilna tekstura */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 1000;
}


/* ═══════════════════════════════════════════════════════════════════════════
   4. LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 16px;
}

.container-md {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-lg {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.wrapper {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
}

.section {
    margin-bottom: 24px;
}

.section:last-child {
    margin-bottom: 0;
}


/* ═══════════════════════════════════════════════════════════════════════════
   5. TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════════════ */

.title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.title-lg {
    font-size: 2.5rem;
}

.title-xl {
    font-size: 3rem;
    line-height: 1.1;
}

.accent {
    color: var(--accent);
}

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

.tagline {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover {
    color: var(--accent-dim);
    text-decoration: underline;
    text-underline-offset: 3px;
}

p a, li a, td a {
    font-weight: 500;
    border-bottom: 1px solid var(--accent-glow);
}

p a:hover, li a:hover, td a:hover {
    border-bottom-color: var(--accent);
    text-decoration: none;
}


/* ═══════════════════════════════════════════════════════════════════════════
   6. BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--accent-dim);
    box-shadow: 0 0 20px var(--accent-glow);
    text-decoration: none;
}

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

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    padding: 0;
    font-family: inherit;
    cursor: pointer;
}

.btn-link:hover {
    text-decoration: underline;
}

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


/* ═══════════════════════════════════════════════════════════════════════════
   7. INPUTS
   ═══════════════════════════════════════════════════════════════════════════ */

.input {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.input-group {
    margin-bottom: 16px;
}

.input-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

select.input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2371717a' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   8. CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
    border-color: var(--accent-glow);
}

.card-highlight {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}


/* ═══════════════════════════════════════════════════════════════════════════
   9. PRICING CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.pricing-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
}

.pricing-card.featured {
    border-color: var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
    position: relative;
}

.pricing-card.featured::before {
    content: attr(data-badge);
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.pricing-name {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.pricing-price {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.pricing-price span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}

.pricing-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.pricing-features {
    list-style: none;
    text-align: left;
    margin-bottom: 24px;
}

.pricing-features li {
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pricing-features li::before {
    content: "✓";
    color: var(--success);
    font-weight: bold;
}


/* ═══════════════════════════════════════════════════════════════════════════
   10. UPLOAD ZONE
   ═══════════════════════════════════════════════════════════════════════════ */

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

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

.upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 20px var(--accent-glow);
}

.upload-zone-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.upload-zone-text {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

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


/* ═══════════════════════════════════════════════════════════════════════════
   11. TABLES
   ═══════════════════════════════════════════════════════════════════════════ */

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tr:hover td {
    background: var(--bg-tertiary);
}


/* ═══════════════════════════════════════════════════════════════════════════
   12. BADGES & STATUS
   ═══════════════════════════════════════════════════════════════════════════ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
}


/* ═══════════════════════════════════════════════════════════════════════════
   13. UTILITIES
   ═══════════════════════════════════════════════════════════════════════════ */

.hidden {
    display: none !important;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.gap-4 { gap: 32px; }


/* ═══════════════════════════════════════════════════════════════════════════
   14. RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .container-lg {
        padding: 0 16px;
    }
}

@media (max-width: 768px) {
    .title-xl {
        font-size: 2.5rem;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container,
    .container-md,
    .container-lg {
        padding: 0 12px;
    }
    
    .wrapper,
    .card {
        padding: 16px;
    }
    
    .title-xl {
        font-size: 2rem;
    }
    
    .btn-lg {
        padding: 14px 24px;
        font-size: 1rem;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   PRICING PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 700px;
    margin: 0 auto;
}

.pricing-note {
    max-width: 600px;
    margin: 32px auto 0;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

/* FAQ */
.faq-list {
    max-width: 700px;
    margin: 48px auto 0;
}

.faq-item {
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

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

/* CTA section spacing */
.section-block.section-cta {
    padding-bottom: 80px;
}

/* FAQ section title spacing */
.bg-secondary .section-title {
    padding-top: 32px;
}

@media (max-width: 768px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   DASHBOARD PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

.dashboard {
    padding: 32px 0 64px;
}

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

.dashboard-usage {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.usage-count {
    font-size: 0.95rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
}

.dashboard-main {
    min-width: 0;
}

.dashboard-main .card {
    margin-bottom: 24px;
}

.dashboard-main .card:last-child {
    margin-bottom: 0;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Kartice v sidebarju - enaka višina za vidne kartice */
.dashboard-sidebar > .card {
    display: flex;
    flex-direction: column;
}

.dashboard-sidebar > .card:not(.hidden):first-child,
.dashboard-sidebar > .card:not(.hidden):last-child {
    min-height: 280px;
}

.dashboard-sidebar > .card .btn:last-child {
    margin-top: auto;
}

/* Stats */
.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.stat-item:last-of-type {
    border-bottom: none;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stat-value {
    font-weight: 600;
}

/* Format toggle buttons */
.format-toggle-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.format-toggle {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
    width: 100%;
}

.format-toggle:hover {
    border-color: var(--text-muted);
    background: var(--bg-secondary);
}

.format-toggle.active {
    background: var(--accent);
    border-color: var(--accent);
}

.format-toggle.active .format-name {
    color: var(--bg);
}

.format-toggle.active .format-desc {
    color: rgba(255, 255, 255, 0.8);
}

.format-name {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text);
}

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

/* Minimax status */
.minimax-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.connected {
    background: var(--success);
}

.status-dot.disconnected {
    background: var(--text-muted);
}

.status-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Results */
.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.result-icon {
    font-size: 1.5rem;
}

.result-name {
    font-weight: 500;
}

.result-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

/* Processing state */
.result-item.processing {
    opacity: 0.7;
}

.result-item.processing .result-icon {
    animation: spin 1s linear infinite;
}

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

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    overflow: auto;
}

.modal-body pre {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    margin: 0;
}

/* Dashboard responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .dashboard-sidebar .card {
        flex: 1;
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}
