/* Reset a základní styly */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #6b7280;
    --secondary-hover: #4b5563;
    --success-color: #10b981;
    --error-color: #ef4444;
    --background: #f9fafb;
    --surface: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 8px;
    --transition: all 0.2s ease-in-out;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    margin-bottom: 2rem;
    text-align: center;
}

.main-title {
    margin-bottom: 1rem;
}

.header-main-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 2.5rem;
    font-weight: 700;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.header-main-link:hover {
    color: var(--primary-hover);
    background: var(--background);
    transform: translateY(-2px);
    text-decoration: underline;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Tlačítka */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-link {
    background: none;
    color: var(--primary-color);
    padding: 0.5rem 0;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--primary-hover);
}

/* Akce */
.actions {
    margin-bottom: 2rem;
    text-align: center;
}

/* Statistiky */
.statistics-section {
    margin-bottom: 3rem;
}

.statistics-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.stats-detail-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.stats-detail-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.top-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.top-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.top-list li:last-child {
    border-bottom: none;
}

.list-name {
    color: var(--text-primary);
    font-weight: 500;
}

.list-value {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.list-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    flex: 1;
}

.list-link:hover {
    text-decoration: underline;
}

.list-date {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-left: 1rem;
}

/* Náhodná hra */
.random-game {
    text-align: center;
    padding: 1rem 0;
}

.random-game-link {
    display: block;
    font-size: 1.25rem;
    color: var(--primary-color);
    text-decoration: none;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.random-game-link:hover {
    text-decoration: underline;
}

.random-game-author {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0.5rem 0 1rem 0;
}

.random-game .btn {
    margin-top: 0.5rem;
}

/* Přehled projektů */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.projekty-seznam h2 {
    font-size: 1.75rem;
    margin: 0;
    color: var(--text-primary);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-controls label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.sort-controls select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
}

.projekty-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--surface);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.projekty-stats p {
    margin: 0;
}

.projekty-stats strong {
    color: var(--text-primary);
}

.projekty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.projekt-card {
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.projekt-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.projekt-header {
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
}

.projekt-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.projekt-dne {
    border: 2px solid #ffd700;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.projekt-dne-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.projekt-body {
    padding: 1.25rem;
    flex-grow: 1;
}

.projekt-autor {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.projekt-autor strong {
    color: var(--text-primary);
}

.projekt-poznamky {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.projekt-datum {
    margin-top: auto;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.projekt-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--background);
}

.projekt-footer {
    display: flex;
    gap: 0.5rem;
}

.projekt-footer .btn {
    flex: 1;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-info {
    background-color: #3b82f6;
    color: white;
}

.btn-info:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Stránkování */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination-pages {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination-page {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--surface);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    min-width: 2.5rem;
    text-align: center;
    transition: var(--transition);
}

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

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

.pagination-dots {
    padding: 0.5rem;
    color: var(--text-secondary);
}

/* Password display */
.password-display {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: #d1fae5;
    border-left: 4px solid var(--success-color);
    border-radius: var(--border-radius);
}

.password-box {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.password-box code {
    background: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    flex: 1;
    min-width: 200px;
}

.password-warning {
    margin: 0.5rem 0 0 0;
    font-size: 0.875rem;
    color: #065f46;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    color: var(--text-secondary);
}

.empty-state p {
    margin-bottom: 0.5rem;
}

/* Formulář */
.project-form {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    max-width: 700px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.required {
    color: var(--error-color);
}

.form-group input[type="text"],
.form-group input[type="file"],
.form-group textarea,
.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-actions .btn {
    flex: 1;
}

/* Info box */
.info-box {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.info-box h4 {
    margin-bottom: 0.75rem;
    color: #92400e;
}

.info-box ul {
    margin-left: 1.5rem;
    color: #78350f;
}

.info-box li {
    margin-bottom: 0.5rem;
}

/* Alerty */
.alert {
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.alert-success {
    background: #d1fae5;
    border-left: 4px solid var(--success-color);
    color: #065f46;
}

.alert-success h3 {
    margin-bottom: 0.75rem;
    color: #047857;
}

.alert-error {
    background: #fee2e2;
    border-left: 4px solid var(--error-color);
    color: #991b1b;
}

.alert-error h3 {
    margin-bottom: 0.75rem;
    color: #dc2626;
}

.alert ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.alert li {
    margin-bottom: 0.25rem;
}

/* Footer */
footer {
    margin-top: auto;
    padding-top: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Refresh indicator */
.refresh-indicator {
    background: var(--background);
    padding: 0.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Responzivní design */
@media (max-width: 768px) {
    .header-main-link {
        font-size: 1.75rem;
    }
    
    header h2 {
        font-size: 1.5rem;
    }
    
    header h1 {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-details {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .projekty-grid {
        grid-template-columns: 1fr;
    }

    .projekt-footer {
        flex-direction: column;
    }

    .projekt-footer .btn {
        width: 100%;
    }

    .projekty-stats {
        flex-direction: column;
        gap: 0.5rem;
    }

    .pagination {
        flex-direction: column;
    }

    .pagination-pages {
        flex-wrap: wrap;
        justify-content: center;
    }

    .project-form {
        padding: 1.5rem;
    }

    .form-actions {
        flex-direction: column;
    }
}

/* Editovatelné projekty */
.editable-projects-section {
    margin-bottom: 2rem;
}

.editable-project {
    border: 2px solid var(--primary-color);
    position: relative;
}

.editable-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.projekt-expire {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.projekt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Kategorie */
.projekt-kategorie {
    margin-bottom: 0.5rem;
}

.kategorie-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.kategorie-web {
    background: #3b82f6;
    color: white;
}

.kategorie-hra {
    background: #10b981;
    color: white;
}

.kategorie-aplikace {
    background: #f59e0b;
    color: white;
}

/* Filtry a ovládací prvky */
.controls-section {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 1rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: var(--text-primary);
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

.filter-select:hover {
    border-color: var(--primary-color);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Téma box */
.tema-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tema-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tema-icon {
    font-size: 2rem;
}

.tema-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.tema-content {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 1.25rem;
}

.tema-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    line-height: 1.5;
}

.tema-popis {
    font-size: 1rem;
    margin: 0;
    opacity: 0.95;
    line-height: 1.6;
}

/* AI Chat Widget */
.ai-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.ai-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition);
    position: relative;
}

.ai-chat-toggle:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
    box-shadow: 0 12px 20px -5px rgba(79, 70, 229, 0.3);
}

.ai-chat-toggle:active {
    transform: scale(0.95);
}

.ai-chat-icon {
    display: block;
}

.ai-chat-modal {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 400px;
    height: 600px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 120px);
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
}

.ai-chat-modal.active {
    display: flex;
}

.ai-chat-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
}

.ai-chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1;
}

.ai-chat-providers {
    display: flex;
    gap: 0.5rem;
}

.ai-provider-btn {
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.ai-provider-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-provider-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    font-weight: 600;
}

.ai-chat-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.ai-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.ai-chat-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.ai-chat-info {
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.ai-chat-info p {
    margin: 0;
}

.ai-chat-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.btn-block {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    font-size: 1rem;
}

/* Responzivní design pro chat */
@media (max-width: 768px) {
    .ai-chat-modal {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 90px;
        right: 10px;
        left: 10px;
    }
    
    .ai-chat-toggle {
        width: 56px;
        height: 56px;
        bottom: 15px;
        right: 15px;
    }
}

