/*
 * Administrace branapisecka.cz
 * Společné styly pro celý administrační panel
 */

/* Reset a základní styly */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    line-height: 1.6;
}

/* === PŘIHLAŠOVACÍ STRÁNKA === */

.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #333;
    font-size: 24px;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

/* === HLAVIČKA === */

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* První řádek - Logo a uživatel */
.header-top {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header h1 {
    font-size: 22px;
    white-space: nowrap;
}

/* Druhý řádek - Wrapper pro hamburger a navigaci */
.header-nav-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 15px 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Hamburger tlačítko */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    flex-shrink: 0;
}

.hamburger-btn span {
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Navigace */
.header-nav {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    flex: 1;
}

.header-nav .nav-item {
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.header-nav .nav-item:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.header-nav .nav-item.active {
    background-color: rgba(255, 255, 255, 0.25);
    font-weight: bold;
}

.nav-icon {
    font-size: 18px;
}

/* Overlay pro mobilní menu */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

/* Uživatelské info */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    text-align: right;
}

.user-name strong {
    display: block;
    font-size: 15px;
}

.user-name small {
    font-size: 11px;
    opacity: 0.9;
}

/* === RESPONZIVNÍ DESIGN PRO MENU === */

@media (max-width: 1024px) {
    .header h1 {
        font-size: 18px;
    }

    .header-nav .nav-item {
        padding: 8px 12px;
        font-size: 13px;
    }

    .nav-icon {
        font-size: 16px;
    }
}

@media (max-width: 900px) {
    .hamburger-btn {
        display: flex !important;
    }

    .header-top {
        flex-wrap: nowrap;
    }

    .header-nav-wrapper {
        padding: 10px 20px;
        border-top: none;
    }

    .header-nav {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 280px;
        max-width: 280px;
        height: 100vh;
        background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 80px 0 20px 0 !important;
        margin: 0 !important;
        gap: 0;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
        transition: left 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        flex: none !important;
    }

    .header-nav.active {
        left: 0 !important;
    }

    .header-nav .nav-item {
        padding: 18px 25px;
        border-radius: 0;
        justify-content: flex-start;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .header-nav .nav-item:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }

    .header-nav .nav-item.active {
        background-color: rgba(255, 255, 255, 0.3);
        border-left: 4px solid white;
    }

    .user-name {
        display: none;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 16px;
    }

    .header-nav {
        width: 100%;
        left: -100%;
    }

    .user-info .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* === TLAČÍTKA === */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-light {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-light:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:active {
    transform: translateY(0);
}

/* === FORMULÁŘE === */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #333;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* === ZPRÁVY === */

.alert {
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* === KONTEJNERY === */

.container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 22px;
}

.card h3 {
    color: #667eea;
    font-size: 18px;
    margin-bottom: 15px;
}

.card p {
    color: #666;
    line-height: 1.6;
}

/* === GRID SYSTÉMY === */

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* === STATISTIKY === */

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.stat-card h3 {
    color: #667eea;
    font-size: 18px;
    margin-bottom: 15px;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

/* === MENU === */

.menu-item {
    background: white;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: block;
}

.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.menu-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.menu-item h3 {
    color: #667eea;
    font-size: 18px;
    margin-bottom: 10px;
}

.menu-item p {
    color: #666;
    font-size: 14px;
}

/* === TABULKY === */

.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: bold;
    font-size: 14px;
}

td {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
}

tbody tr:hover {
    background-color: #f5f5f5;
}

tbody tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.table-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* === BADGE === */

.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 12px;
    text-align: center;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

/* === UTILITY TŘÍDY === */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.p-0 { padding: 0; }
.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.align-center {
    align-items: center;
}

.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.gap-3 { gap: 30px; }

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* === LOADING SPINNER === */

.loading {
    text-align: center;
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === MODAL === */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: #333;
    font-size: 22px;
}

.modal-close {
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    background: none;
    border: none;
}

.modal-close:hover {
    color: #333;
}

.modal-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* === RESPONZIVITA === */

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-nav {
        flex-direction: column;
        width: 100%;
    }

    .header-nav a {
        width: 100%;
    }

    .user-info {
        flex-direction: column;
        width: 100%;
    }

    .user-name {
        text-align: center;
    }

    .table-container {
        font-size: 12px;
    }

    th, td {
        padding: 10px 5px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-row .form-group {
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 30px 20px;
    }

    .card {
        padding: 20px;
    }

    .stat-number {
        font-size: 28px;
    }

    .menu-icon {
        font-size: 36px;
    }
}
