/**
 * MOL Správa směn - Společný stylesheet (reports, exports, questionnaire)
 * Barvy a tokeny jsou centralizované v theme.css a mapované na Fresh Corner paletu.
 * Společné UI vzorce (tlačítka, karty, tabulky, alerty) přes components.css.
 */
@import url('theme.css');
@import url('components.css');

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--fc-bg);
    color: var(--fc-brown);
    min-height: 100vh;
    line-height: 1.6;
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    color: var(--color-white);
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.header-left h1 {
    font-size: 24px;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 900;
}

.user-info {
    font-size: 13px;
    opacity: 0.9;
}

/* Desktop Navigation */
.header-nav {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    max-width: 100%;
}

.nav-group {
    display: flex;
    gap: 6px;
    align-items: center;
    padding-right: 10px;
    border-right: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    position: relative;
}

.nav-group:last-child {
    border-right: none;
    padding-right: 0;
}

.nav-group-label {
    font-size: 10px;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: 3px;
    display: none;
}

/* Zobrazit labely na širokých obrazovkách */
@media (min-width: 1400px) {
    .nav-group-label {
        display: inline-block;
    }
    
    .nav-group {
        gap: 8px;
        padding-right: 15px;
    }
    
    .header-nav {
        gap: 10px;
    }
}

/* Hamburger menu pro mobil */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 3px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* ===== BUTTONS ===== */
.btn {
    padding: 8px 12px;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    transition: all 0.2s;
    white-space: nowrap;
    box-sizing: border-box;
    vertical-align: middle;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary-lighter) 100%);
    color: var(--color-white);
    box-shadow: 0 4px 15px rgba(8, 131, 149, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(8, 131, 149, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-white);
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-secondary.active {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    font-weight: 900;
}

.btn-danger {
    background: var(--color-danger);
    color: var(--color-white);
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* ===== DROPDOWN MENU ===== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
    position: relative;
    padding-right: 25px !important;
}

.dropdown-toggle::after {
    content: '▼';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    transition: transform 0.2s;
}

.dropdown.active .dropdown-toggle::after {
    transform: translateY(-50%) rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    border-radius: var(--border-radius-md);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    min-width: 200px;
    padding: 8px 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu .btn {
    width: 100%;
    text-align: left;
    border-radius: 0;
    margin: 2px 0;
    padding: 10px 15px;
    background: transparent;
    border: none;
    white-space: nowrap;
}

.dropdown-menu .btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.dropdown-menu .btn.active {
    background: rgba(255, 255, 255, 0.25);
    font-weight: 900;
}

/* Desktop/Mobile only elementy */
.mobile-only {
    display: none;
}

.desktop-only {
    display: inline-block;
}

/* ===== CONTAINER & CARDS ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

.card {
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
}

.card h2 {
    color: var(--color-primary-dark);
    margin-bottom: var(--spacing-lg);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-primary-light);
    font-weight: 900;
}

/* ===== CONTROLS ===== */
.controls {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    color: var(--color-primary-dark);
    font-weight: 800;
    font-size: 14px;
}

input, select, textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--color-gray-200);
    border-radius: var(--border-radius-md);
    font-size: 14px;
    transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary-lighter);
    box-shadow: 0 0 0 3px rgba(15, 193, 219, 0.12);
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--border-radius-full);
    font-size: 12px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary-lighter) 100%);
    color: var(--color-white);
    margin-left: 8px;
}

/* ===== ALERTS ===== */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-lg);
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--color-success);
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--color-danger);
}

/* ===== TABLES ===== */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 800;
    background: var(--color-gray-50);
    border-bottom: 2px solid var(--color-gray-200);
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--color-gray-100);
}

tr:hover {
    background: var(--color-gray-50);
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 22, 26, 0.7);
    z-index: 1000;
    padding: var(--spacing-lg);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

/* ===== LOGIN PAGE STYLES ===== */
.login-container {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 440px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary-light) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 4px 15px rgba(8, 131, 149, 0.3);
}

.logo-text {
    font-size: 36px;
    font-weight: 900;
    color: white;
    letter-spacing: 2px;
}

.login-header h1 {
    font-size: 28px;
    color: var(--color-primary-dark);
    margin-bottom: 8px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.error-message {
    background: #fee;
    border: 1px solid #fcc;
    border-left: 4px solid var(--color-danger);
    color: #c33;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.remember-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
    margin-bottom: 20px;
    user-select: none;
}

.remember-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary-light);
    cursor: pointer;
}

.remember-row span {
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.login-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary-lighter) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(8, 131, 149, 0.3);
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(8, 131, 149, 0.4);
}

.login-button:active {
    transform: translateY(0);
}

/* ===== MENU OVERLAY ===== */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.menu-overlay.active {
    display: block;
}

/* Tlačítko pro zavření mobilního menu */
.close-menu {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: white;
    font-size: 35px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    z-index: 1000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background 0.2s;
}

.close-menu:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ===== RESPONSIVE MEDIA QUERIES ===== */

/* Mobilní navigace */
@media (max-width: 1100px) {
    .hamburger {
        display: flex;
    }

    .header-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 320px;
        height: 100vh;
        background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
        flex-direction: column;
        align-items: stretch;
        padding: 60px 20px 20px;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
        transition: right 0.3s ease;
        z-index: 999;
        overflow-y: auto;
        gap: 0;
    }

    .header-nav.active {
        right: 0;
    }

    .header-nav.active .close-menu {
        display: block;
    }

    .nav-group {
        flex-direction: column;
        align-items: stretch;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        padding: 15px 0;
        gap: 0;
    }

    .nav-group:last-child {
        border-bottom: none;
    }

    .nav-group-label {
        display: block;
        margin-bottom: 10px;
        font-size: 11px;
        opacity: 0.6;
    }

    .mobile-only {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .desktop-only {
        display: none !important;
    }

    .nav-group .btn,
    .nav-group a.btn,
    .nav-group button.btn,
    .mobile-only .btn,
    .mobile-only a.btn {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        
        /* OPRAVA PRO ZAROVNÁNÍ TLAČÍTEK V MENU NA MOBILU */
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 12px !important;
        
        padding: 12px 15px !important;
        font-size: 14px !important;
        box-sizing: border-box !important;
        margin-bottom: 8px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        float: none !important;
        clear: both !important;
        position: relative !important;
        flex: none !important;
        flex-grow: 0 !important;
        flex-shrink: 0 !important;
    }

    .nav-group .btn:last-child,
    .nav-group a.btn:last-child,
    .nav-group button.btn:last-child,
    .mobile-only .btn:last-child,
    .mobile-only a.btn:last-child {
        margin-bottom: 0 !important;
    }

    .header-content {
        padding: 0 10px;
    }

    .header-left h1 {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: var(--spacing-md);
    }

    .card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .header-left h1 {
        font-size: 18px;
    }

    .user-info {
        font-size: 12px;
    }

    .badge {
        font-size: 10px;
        padding: 3px 8px;
    }

    .header-nav {
        width: 280px;
    }

    .login-container {
        padding: 30px 20px;
    }

    .login-header h1 {
        font-size: 24px;
    }

    .logo {
        width: 70px;
        height: 70px;
    }

    .logo-text {
        font-size: 30px;
    }
}