/**
 * Skladový systém - Main Stylesheet
 * Desktop-first responsive design
 */

/* ============================================
   CSS Variables - Shared Colors
   ============================================ */
:root {
    /* Status colors (shared across themes) */
    --status-ok: #16a34a;
    --status-low: #eab308;
    --status-critical: #dc2626;
    --status-expiring: #ea580c;

    /* Neutral colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;

    /* Text colors */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Border radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ============================================
   EKOSPOL Theme
   ============================================ */
.theme-ekospol {
    --primary: #1a3d2e;
    --primary-light: #2d5a45;
    --primary-dark: #0f261c;
    --accent: #4a7c59;
    --bg: #f8f5f2;
    --bg-alt: #f0ebe6;
}

/* ============================================
   ZOO Tábor Theme
   ============================================ */
.theme-zoo {
    --primary: #e86a1e;
    --primary-light: #f28c4d;
    --primary-dark: #c45a18;
    --accent: #2c2c2c;
    --bg: #fffaf6;
    --bg-alt: #fff3eb;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg, var(--gray-50));
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: var(--spacing-md);
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================
   Login Page
   ============================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: var(--spacing-lg);
}

.login-box {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-logo {
    max-width: 300px;
    height: auto;
}

#logo-ekospol {
    height: 51px;
}

#logo-zoo {
    height: 100px;
}

.login-box h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: var(--spacing-sm);
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    font-size: 0.875rem;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: var(--spacing-lg);
}

label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 26, 61, 46), 0.1);
}

.form-control::placeholder {
    color: var(--gray-500);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    transition: all 0.15s ease-in-out;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    text-decoration: none;
}

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

/* ============================================
   Company Switcher (Login)
   ============================================ */
.login-company-switch {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.login-company-switch p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.company-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

.company-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--gray-100);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.company-btn:hover {
    background: var(--gray-200);
}

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

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 0.75rem 1rem;
    margin-bottom: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
}

.alert-success {
    color: #065f46;
    background-color: #d1fae5;
    border-color: #6ee7b7;
}

.alert-error {
    color: #991b1b;
    background-color: #fee2e2;
    border-color: #fca5a5;
}

.alert-warning {
    color: #92400e;
    background-color: #fef3c7;
    border-color: #fcd34d;
}

.alert-info {
    color: #1e40af;
    background-color: #dbeafe;
    border-color: #93c5fd;
}

/* ============================================
   Footer
   ============================================ */
.login-footer {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.login-footer p {
    font-size: 0.75rem;
    color: var(--text-light);
    margin: 0;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .login-container {
        padding: var(--spacing-md);
    }

    .login-box {
        padding: var(--spacing-lg);
    }

    .company-logo {
        max-width: 150px;
    }

    h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: var(--spacing-md);
    }

    .company-buttons {
        flex-direction: column;
    }
}

/* ============================================
   Modals
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.modal-sm {
    max-width: 400px;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: background 0.15s ease-in-out;
}

.modal-close:hover {
    background: var(--gray-100);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-lg);
}

.card-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--gray-200);
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--gray-200);
}

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

.table thead {
    background: var(--gray-50);
}

.table th {
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
}

.table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--gray-200);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table .text-center {
    text-align: center;
}

.table .text-right {
    text-align: right;
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    justify-content: center;
    margin-top: var(--spacing-lg);
}

.pagination a,
.pagination span {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
}

.pagination a:hover {
    background: var(--gray-100);
}

.pagination .active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.page-header h1 {
    margin: 0;
    font-size: 1.875rem;
    color: var(--text-primary);
}
