/* Reset a základné štýly */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6200;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #dee2e6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #212529;
    background-color: #f5f5f5;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 20px;
    gap: 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-right: 20px;
}

.navbar-brand a {
    font-size: 19px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    padding: 15px 0;
    display: block;
    white-space: nowrap;
}

.navbar-logo {
    height: 40px;
    width: auto;
    display: block;
}

.beta-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #ff6200 0%, #ff8c42 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(255, 98, 0, 0.3);
    animation: beta-pulse 2s ease-in-out infinite;
    white-space: nowrap;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

@keyframes beta-pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(255, 98, 0, 0.3);
    }
    50% {
        box-shadow: 0 4px 12px rgba(255, 98, 0, 0.5);
    }
}

.navbar-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-menu li {
    position: relative;
}

.navbar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
    font-size: 14px;
    border-radius: 4px;
    margin: 0 2px;
}

.navbar-menu a:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

.navbar-menu a.active {
    color: var(--primary-color);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-credits {
    padding: 8px 15px;
    background: var(--light-color);
    border-radius: 20px;
    font-size: 13px;
}

/* Kredit ako menu položka */
.navbar-credits {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: var(--light-color);
    border-radius: 4px;
    cursor: default;
    margin-left: auto;
    margin: 0 2px;
    height: 45px;
}

.navbar-credits .credits-display {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
}

.navbar-credits .credits-display strong {
    color: var(--primary-color);
}

.navbar-credits .credits-display i.bi-coin {
    color: #ffc107;
    font-size: 14px;
}

.navbar-credits .credits-display a:hover {
    opacity: 0.7;
    transition: opacity 0.2s;
}

.user-icon {
    font-size: 18px;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    list-style: none;
    padding: 5px 0;
    margin: 0;
    border-radius: 4px;
}

.dropdown-menu-right {
    left: auto;
    right: 0;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    padding: 10px 20px;
    display: block;
    color: #333;
    text-decoration: none;
}

.dropdown-menu li a:hover {
    background: var(--light-color);
}

/* Main Content */
.main-content {
    padding: 20px 0;
    min-height: calc(100vh - 140px);
}

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #ff6200;
    animation: spin 1s ease-in-out infinite;
}

.loading-spinner-large {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

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

.ai-thinking {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #ff6b2c 0%, #e85d1c 100%);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.ai-thinking .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

.ai-brain-icon {
    font-size: 24px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error,
.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: #cc5200;
}

.btn-secondary {
    background: var(--secondary-color);
    color: #fff;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-success {
    background: var(--success-color);
    color: #fff;
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
}

.btn-info {
    background: var(--info-color);
    color: #fff;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

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

/* Form */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Tables */
.table-container {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--light-color);
    font-weight: 600;
    color: #333;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table .actions {
    white-space: nowrap;
}

.data-table .actions .btn {
    margin-right: 5px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 3px;
}

.badge-primary {
    background: var(--primary-color);
    color: #fff;
}

.badge-secondary {
    background: var(--secondary-color);
    color: #fff;
}

.badge-success {
    background: var(--success-color);
    color: #fff;
}

.badge-warning {
    background: var(--warning-color);
    color: #333;
}

.badge-danger {
    background: var(--danger-color);
    color: #fff;
}

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    font-size: 40px;
}

.stat-content h3 {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-content p {
    color: #666;
    font-size: 14px;
}

.dashboard-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.recent-activity {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.recent-activity h2 {
    margin-bottom: 20px;
}

/* Login Page */
.login-page {
    background: #fff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.login-logo {
    max-width: 200px;
    height: auto;
    margin: 0 auto 30px;
    display: block;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.login-info {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: #666;
}

.login-powered-by {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.powered-by-logo {
    height: 35px;
    width: auto;
}

.login-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid var(--border-color);
    padding: 15px 0;
    text-align: center;
    color: #666;
    font-size: 13px;
}

.login-footer p {
    margin: 5px 0;
}

.login-footer-version {
    font-size: 12px;
}

.login-footer-version a {
    color: var(--primary-color);
    text-decoration: none;
}

.login-footer-version a:hover {
    text-decoration: underline;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 28px;
}

/* Filters */
.filters-panel {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

/* Bulk Actions */
.bulk-actions-panel {
    background: var(--primary-color);
    color: #fff;
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bulk-actions-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 4px;
}

.pagination-link {
    padding: 8px 16px;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
}

.pagination-link:hover {
    background: #cc5200;
}

.pagination-info {
    color: #666;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
}

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

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 20px;
    background: var(--light-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
    width: 0%;
}

#generationProgress {
    padding: 20px 0;
    min-height: 100px;
}

#progressText {
    text-align: center;
    margin-top: 10px;
    font-weight: 500;
}

/* Footer */
.footer {
    background: #fff;
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    text-align: center;
    color: #666;
}

/* Utility Classes */
.text-muted {
    color: #666;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #666;
}

code {
    background: var(--light-color);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* Sidebar */
.sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1100;
    background: var(--primary-color);
    color: #fff;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(255, 98, 0, 0.3);
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: #cc5200;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(255, 98, 0, 0.4);
}

.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: #fff;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1200;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #ff6b2c 0%, #e85d1c 100%);
    color: #fff;
    position: relative;
}

.sidebar-logo-img {
    width: 180px;
    height: auto;
    object-fit: contain;
    background: transparent;
}

.sidebar-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    opacity: 0.8;
    transition: opacity 0.2s;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.sidebar-close:hover {
    opacity: 1;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.sidebar-link i {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.sidebar-link:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(255, 107, 44, 0.1) 0%, rgba(232, 93, 28, 0.1) 100%);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

.sidebar-link.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.sidebar-link .badge {
    margin-left: auto;
    font-size: 10px;
}

.sidebar-divider {
    margin: 20px 0;
    border: 0;
    border-top: 1px solid var(--border-color);
}

.sidebar-section-title {
    padding: 10px 20px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1150;
}

.sidebar-overlay.active {
    display: block;
}

/* Adjust body when sidebar is active */
body.sidebar-open {
    overflow: hidden;
}

/* Flag Icons Styling */
.fi {
    display: inline-block;
    width: 1.33em;
    line-height: 1em;
    vertical-align: middle;
    margin-right: 0.25em;
}

/* Flags in tables */
.data-table .fi {
    font-size: 1.2em;
}

/* Flags in tabs */
.nav-tabs .fi {
    font-size: 1.1em;
    margin-right: 0.35em;
}

/* Flags in language checkboxes */
.language-checkbox-label .fi {
    font-size: 1.5em;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 260px;
        left: -260px;
    }
    
    .sidebar-toggle {
        top: 15px;
        left: 15px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}
