/**
 * STYLE.CSS - HLAVNÍ ZÁKLADNÍ STYLY
 * ===================================
 * Globální styly pro celou aplikaci
 * Všechny aplikace dědí z tohoto souboru
 * Light mode výchozí
 */

/* ==========================================================================
   CSS PROMĚNNÉ - LIGHT MODE (VÝCHOZÍ)
   ========================================================================== */

:root {
    /* Barvy */
    --color-primary: #667eea;
    --color-primary-dark: #5568d3;
    --color-secondary: #764ba2;
    --color-accent: #ec4899;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;
    
    /* Pozadí */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    
    /* Text */
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    
    /* Karty */
    --card-bg: #ffffff;
    --card-border: #e5e7eb;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    
    /* Formuláře */
    --input-bg: #ffffff;
    --input-border: #d1d5db;
    --input-text: #1f2937;
    
    /* Tabulky */
    --table-bg: #ffffff;
    --table-header-bg: #f8fafc;
    --table-border: #e5e7eb;
    --table-hover: rgba(0, 0, 0, 0.02);
    
    /* Bordery */
    --border-color: #e5e7eb;
    
    /* Stíny */
    --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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
    
    /* Header */
    --header-height: 70px;
    --header-bg: rgba(15, 23, 42, 0.8);
    --header-border: rgba(102, 126, 234, 0.2);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ==========================================================================
   SCROLLBAR
   ========================================================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ==========================================================================
   HEADER - VŽDY MODRÝ GRADIENT
   ========================================================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--header-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--header-border);
    z-index: 1000;
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* ==========================================================================
   LOGO
   ========================================================================== */

.logo-section {
    flex-shrink: 0;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.logo-link:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.main-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s;
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(102, 126, 234, 0.2);
    color: white;
}

.nav-link.active {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}

/* ==========================================================================
   DROPDOWN
   ========================================================================== */

.dropdown-menu {
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    min-width: 280px;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
}

.dropdown-item {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1.25rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.dropdown-item:hover, 
.dropdown-item:focus {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}

.dropdown-item i {
    font-size: 1.1rem;
    width: 24px;
}

.dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

/* ==========================================================================
   USER SECTION
   ========================================================================== */

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-details {
    text-align: right;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
}

.user-role {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.logout-btn, .login-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.login-btn {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.login-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    color: #667eea;
}

/* ==========================================================================
   DARK MODE TOGGLE
   ========================================================================== */

.dark-mode-toggle {
    position: relative;
    width: 60px;
    height: 30px;
    background: var(--bg-tertiary);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.dark-mode-toggle::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

[data-theme="dark"] .dark-mode-toggle::before {
    transform: translateX(30px);
}

.dark-mode-toggle i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.dark-mode-toggle .fa-sun {
    left: 8px;
    color: #ffc107;
    opacity: 1;
}

.dark-mode-toggle .fa-moon {
    right: 8px;
    color: #6c757d;
    opacity: 0;
}

[data-theme="dark"] .dark-mode-toggle .fa-sun {
    opacity: 0;
}

[data-theme="dark"] .dark-mode-toggle .fa-moon {
    opacity: 1;
    color: #ffc107;
}

/* ==========================================================================
   TOAST NOTIFICATIONS - PERFEKTNÍ SYSTÉM
   ========================================================================== */

.toast-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}

.toast-notification {
    min-width: 320px;
    max-width: 400px;
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: all;
    backdrop-filter: blur(10px);
}

@keyframes slideInRight {
    from {
        transform: translateX(500px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(500px);
        opacity: 0;
    }
}

.toast-notification.removing {
    animation: slideOutRight 0.3s ease forwards;
}

.toast-notification.success {
    border-left: 4px solid var(--color-success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, var(--card-bg) 100%);
}

.toast-notification.error {
    border-left: 4px solid var(--color-danger);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, var(--card-bg) 100%);
}

.toast-notification.warning {
    border-left: 4px solid var(--color-warning);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, var(--card-bg) 100%);
}

.toast-notification.info {
    border-left: 4px solid var(--color-info);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, var(--card-bg) 100%);
}

.toast-notification .toast-icon {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.toast-notification.success .toast-icon {
    color: var(--color-success);
}

.toast-notification.error .toast-icon {
    color: var(--color-danger);
}

.toast-notification.warning .toast-icon {
    color: var(--color-warning);
}

.toast-notification.info .toast-icon {
    color: var(--color-info);
}

.toast-notification .toast-content {
    flex: 1;
    min-width: 0;
}

.toast-notification .toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 15px;
    color: var(--text-primary);
}

.toast-notification .toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    word-wrap: break-word;
}

.toast-notification .toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.toast-notification .toast-close:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */

.main-content {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    padding: 0;
}

/* ==========================================================================
   CARDS
   ========================================================================== */

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: var(--table-header-bg);
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--card-border);
    padding: 1rem 1.25rem;
}

/* ==========================================================================
   FORMS
   ========================================================================== */

.form-control,
.form-select {
    background-color: var(--input-bg);
    border: 2px solid var(--input-border);
    color: var(--input-text);
    border-radius: var(--radius-md);
    padding: 0.625rem 0.875rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--input-bg);
    border-color: var(--color-primary);
    color: var(--input-text);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ==========================================================================
   TABLES
   ========================================================================== */

.table {
    background-color: var(--table-bg);
    color: var(--text-primary);
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background-color: var(--table-header-bg);
    color: var(--text-secondary);
    border-bottom: 2px solid var(--table-border);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table tbody td {
    border-bottom: 1px solid var(--table-border);
    padding: 1rem;
    color: var(--text-primary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

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

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 0.875rem;
}

.btn:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--color-success), #059669);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-danger), #dc2626);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--color-warning), #d97706);
    color: white;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

.btn-warning:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
    color: white;
}

.btn-light {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-light:hover {
    background: var(--bg-tertiary);
    border-color: var(--color-primary);
    color: var(--text-primary);
}

/* ==========================================================================
   ALERTS
   ========================================================================== */

.alert {
    border-radius: var(--radius-lg);
    border: 1px solid;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: var(--color-success);
    color: #065f46;
}

.alert-danger,
.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--color-danger);
    color: #991b1b;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: var(--color-warning);
    color: #92400e;
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: var(--color-info);
    color: #1e40af;
}

/* ==========================================================================
   BADGES
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--radius-md);
    white-space: nowrap;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)) !important;
    color: white;
}

.badge.bg-success {
    background: var(--color-success) !important;
    color: white;
}

.badge.bg-danger {
    background: var(--color-danger) !important;
    color: white;
}

.badge.bg-warning {
    background: var(--color-warning) !important;
    color: white;
}

.badge.bg-info {
    background: var(--color-info) !important;
    color: white;
}

/* ==========================================================================
   MODALS
   ========================================================================== */

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    background: var(--table-header-bg);
    border-bottom: 1px solid var(--card-border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 1.25rem 1.5rem;
}

.modal-title {
    color: var(--text-primary);
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--card-border);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    padding: 1rem 1.5rem;
}

/* ==========================================================================
   SCROLL TO TOP
   ========================================================================== */

.scroll-top-modern {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff;
    border: none;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-top-modern:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.6);
}

.scroll-top-modern.visible {
    display: flex;
}

/* ==========================================================================
   MOBILE NAVIGATION
   ========================================================================== */

.mobile-nav-toggle {
    display: none;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-nav-toggle:hover {
    background: rgba(102, 126, 234, 0.3);
}

.mobile-nav-menu {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    z-index: 999;
    overflow-y: auto;
}

.mobile-nav-menu.show {
    display: block;
}

.mobile-nav-content {
    padding: 1rem;
}

.mobile-nav-item {
    display: block;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.mobile-nav-item:hover {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.text-primary { color: var(--color-primary) !important; }
.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-info { color: var(--color-info) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-primary { background-color: var(--color-primary) !important; }
.bg-success { background-color: var(--color-success) !important; }
.bg-danger { background-color: var(--color-danger) !important; }
.bg-warning { background-color: var(--color-warning) !important; }
.bg-info { background-color: var(--color-info) !important; }

.border-primary { border-color: var(--color-primary) !important; }
.border-success { border-color: var(--color-success) !important; }
.border-danger { border-color: var(--color-danger) !important; }
.border-warning { border-color: var(--color-warning) !important; }
.border-info { border-color: var(--color-info) !important; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 991px) {
    .nav-container {
        padding: 0 1.5rem;
        gap: 1rem;
    }
    
    .user-details {
        display: none;
    }
    
    .logout-btn span, 
    .login-btn span {
        display: none;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }
    
    .mobile-nav-toggle {
        display: block;
    }
    
    .toast-container {
        top: 80px;
        right: 10px;
        left: 10px;
    }
    
    .toast-notification {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 0.75rem;
        gap: 0.25rem;
    }
    
    .logo-section {
        max-width: 100px;
    }
}

/* ==========================================================================
   PRINT
   ========================================================================== */

@media print {
    body {
        background: white;
        color: black;
    }
    
    .header,
    .scroll-top-modern,
    .mobile-nav-toggle,
    .dark-mode-toggle {
        display: none !important;
    }
}