/*
 * Konwerter SF - Główne Style
 * ===========================
 * Nowoczesny interfejs używający zmiennych z themes.css
 */

/* ============================================
   Reset i Podstawy
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --pico-font-size: 16px;
    --border-radius-sm: 0.375rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    --border-radius-2xl: 1.5rem;
    --border-radius-full: 9999px;
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--theme-bg-secondary);
    color: var(--theme-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* ============================================
   Kontener Główny
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }
}

/* ============================================
   Nagłówek / Header
   ============================================ */
header.main-header {
    background: var(--theme-bg-card);
    border-bottom: 1px solid var(--theme-border);
    padding: 1rem 0;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--theme-shadow);
}

header.main-header .container {
    padding-top: 0;
    padding-bottom: 0;
}

header.main-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--theme-text-primary);
}

.logo-icon {
    width: 2rem;
    height: 2rem;
    background: var(--theme-primary);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-text-inverse);
    font-weight: bold;
}

.nav-menu {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-menu a {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--theme-text-secondary);
    border-radius: var(--border-radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.nav-menu a:hover {
    background-color: var(--theme-bg-secondary);
    color: var(--theme-primary);
}

.nav-menu a.active {
    background-color: var(--theme-bg-tertiary);
    color: var(--theme-primary);
}

.nav-links {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ============================================
   Przyciski
   ============================================ */
.btn,
button:not(.outline):not(.secondary):not(.ghost),
[role="button"]:not(.outline):not(.secondary):not(.ghost),
input[type="submit"]:not(.outline),
input[type="button"]:not(.outline) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--theme-primary) !important;
    color: var(--theme-text-inverse) !important;
    border-color: var(--theme-primary) !important;
}

.btn:hover,
button:not(.outline):not(.secondary):not(.ghost):hover,
[role="button"]:not(.outline):not(.secondary):not(.ghost):hover,
input[type="submit"]:not(.outline):hover,
input[type="button"]:not(.outline):hover {
    background: var(--theme-primary-dark) !important;
    border-color: var(--theme-primary-dark) !important;
    transform: translateY(-1px);
    box-shadow: var(--theme-shadow);
}

.btn-outline,
button.outline,
[role="button"].outline {
    background: transparent !important;
    color: var(--theme-primary) !important;
    border: 2px solid var(--theme-primary) !important;
}

.btn-outline:hover,
button.outline:hover,
[role="button"].outline:hover {
    background: var(--theme-primary) !important;
    color: var(--theme-text-inverse) !important;
}

.btn-secondary,
button.secondary,
[role="button"].secondary {
    background: var(--theme-secondary) !important;
    color: var(--theme-text-inverse) !important;
    border-color: var(--theme-secondary) !important;
}

.btn-secondary:hover,
button.secondary:hover,
[role="button"].secondary:hover {
    background: var(--theme-secondary-dark) !important;
    border-color: var(--theme-secondary-dark) !important;
}

.btn-ghost,
button.ghost,
[role="button"].ghost {
    background: transparent !important;
    color: var(--theme-text-secondary) !important;
    border: none !important;
}

.btn-ghost:hover,
button.ghost:hover,
[role="button"].ghost:hover {
    background: var(--theme-bg-secondary) !important;
    color: var(--theme-primary) !important;
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    text-align: center;
    padding: 4rem 1rem;
    background: var(--theme-gradient-soft);
    border-radius: var(--border-radius-2xl);
    margin-bottom: 3rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--theme-bg-card);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-full);
    font-size: 0.85rem;
    color: var(--theme-text-secondary);
    margin-bottom: 1.5rem;
    box-shadow: var(--theme-shadow);
}

.hero-badge .dot {
    width: 0.5rem;
    height: 0.5rem;
    background: var(--theme-success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--theme-text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero h1 span {
    color: var(--theme-primary);
}

@media (min-width: 768px) {
    .hero h1 {
        font-size: 3.5rem;
    }
}

.hero p {
    font-size: 1.125rem;
    color: var(--theme-text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   Feature Cards
   ============================================ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: var(--theme-bg-card);
    padding: 2rem;
    border-radius: var(--border-radius-xl);
    border: 1px solid var(--theme-border);
    transition: all var(--transition-normal);
}

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

.feature-icon {
    width: 3rem;
    height: 3rem;
    background: var(--theme-bg-tertiary);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--theme-primary);
    font-size: 1.25rem;
}

.feature-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--theme-text-primary);
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--theme-text-muted);
    margin: 0;
}

/* ============================================
   Steps Section
   ============================================ */
.steps-section {
    text-align: center;
    padding: 3rem 0;
}

.steps-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    color: var(--theme-text-primary);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-number {
    width: 3rem;
    height: 3rem;
    background: var(--theme-primary);
    color: var(--theme-text-inverse);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.step h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--theme-text-primary);
    margin-bottom: 0.5rem;
}

.step p {
    font-size: 0.85rem;
    color: var(--theme-text-muted);
    margin: 0;
}

/* ============================================
   Cards / Articles
   ============================================ */
article,
.card {
    background: var(--theme-bg-card);
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    border: 1px solid var(--theme-border);
    box-shadow: var(--theme-shadow);
}

/* ============================================
   Upload Area
   ============================================ */
.upload-area {
    border: 2px dashed var(--theme-border);
    border-radius: var(--border-radius-xl);
    padding: 3rem 2rem;
    text-align: center;
    transition: all var(--transition-normal);
    background: var(--theme-bg-secondary);
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--theme-primary);
    background: var(--theme-bg-tertiary);
}

.upload-area.dragover {
    border-color: var(--theme-primary);
    background: var(--theme-bg-tertiary);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--theme-primary);
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--theme-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--theme-error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--theme-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--theme-info);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ============================================
   Limit Badge
   ============================================ */
.limit-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    background: var(--theme-bg-secondary);
    border-radius: var(--border-radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--theme-text-secondary);
}

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

.limit-badge.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--theme-error);
}

/* ============================================
   Status Badges
   ============================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--theme-success);
}

.status-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--theme-error);
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--theme-warning);
}

/* ============================================
   Tables
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--theme-border);
}

th {
    font-weight: 600;
    color: var(--theme-text-primary);
    background: var(--theme-bg-secondary);
}

tr:hover {
    background: var(--theme-bg-secondary);
}

.history-table {
    font-size: 0.875rem;
}

.history-table td {
    vertical-align: middle;
}

/* ============================================
   Forms
   ============================================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border: 2px solid var(--theme-border);
    border-radius: var(--border-radius-md);
    background: var(--theme-bg-card);
    color: var(--theme-text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb), 0.1);
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--theme-text-primary);
}

/* ============================================
   Footer
   ============================================ */
footer.main-footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--theme-border);
    text-align: center;
    color: var(--theme-text-muted);
    font-size: 0.875rem;
}

/* ============================================
   Theme Switcher
   ============================================ */
.theme-switcher {
    position: relative;
}

.theme-toggle {
    background: var(--theme-bg-secondary);
    border: 1px solid var(--theme-border);
    border-radius: var(--border-radius-md);
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--theme-bg-tertiary);
    border-color: var(--theme-primary);
}

.theme-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--theme-text-secondary);
}

.theme-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--theme-bg-card);
    border: 1px solid var(--theme-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--theme-shadow-lg);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
}

.theme-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.theme-option:first-child {
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.theme-option:last-child {
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

.theme-option:hover {
    background: var(--theme-bg-secondary);
}

.theme-option.active {
    background: var(--theme-bg-tertiary);
}

.theme-color {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 2px solid var(--theme-border);
}

.theme-option span {
    font-size: 0.9rem;
    color: var(--theme-text-primary);
}

/* ============================================
   HTMX Loading States
   ============================================ */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: inline-flex;
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--theme-border);
    border-top-color: var(--theme-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   Utilities
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--theme-primary); }
.text-secondary { color: var(--theme-text-secondary); }
.text-muted { color: var(--theme-text-muted); }

.bg-primary { background-color: var(--theme-primary); }
.bg-secondary { background-color: var(--theme-bg-secondary); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.hidden { display: none; }
.block { display: block; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .hero {
        padding: 2.5rem 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    header.main-header nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-menu {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        margin-top: 0.5rem;
    }

    .nav-links {
        order: 2;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    header.main-header,
    footer.main-footer,
    .theme-switcher,
    .nav-links {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .card, article {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
