/* Frontend Custom Styles */

/* Základní styly */
html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

/* Hlavní gradient pozadí */
.bg-gradient-main {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%) fixed;
    min-height: 100vh;
}

/* Header */
.header-main {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: translateY(-2px);
}

.logo i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.logo:hover i {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
    transform: scale(1.05);
}

.logo span {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.logo:hover span {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* Main content */
.main-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    margin: 2rem 0;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Footer */
.footer-main {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.social-links a {
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-links a:hover {
    color: #f093fb !important;
    transform: translateY(-2px);
}

/* Flash messages */
.flash {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.flash.success {
    background: rgba(25, 135, 84, 0.8);
    color: white;
}

.flash.error {
    background: rgba(220, 53, 69, 0.8);
    color: white;
}

.flash.info {
    background: rgba(13, 202, 240, 0.8);
    color: white;
}

.flash.warning {
    background: rgba(255, 193, 7, 0.8);
    color: #212529;
}

/* Utility classes */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Login Form Styles */
.login-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 450px;
    margin: 0 auto;
}

.form-control-glass {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    backdrop-filter: blur(10px);
}

.form-control-glass::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
}

.form-control-glass:focus {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(102, 126, 234, 0.8) !important;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25) !important;
    color: white !important;
}

.btn-glass {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    backdrop-filter: blur(10px);
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.btn-glass:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%) !important;
}

.btn-glass-outline {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    backdrop-filter: blur(10px);
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.btn-glass-outline:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

/* Error text styling for better visibility on dark background */
.login-card .text-danger {
    color: #ff6b6b !important;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* User dropdown in header */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-info {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.user-info span {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 500;
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 0.5rem 0;
    white-space: nowrap;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 0.5rem;
}

.user-dropdown:hover .user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-item {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.user-menu-item:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.card-game {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Status badges */
.badge-upcoming {
    background: linear-gradient(135deg, #17a2b8, #20c997) !important;
    animation: pulse-subtle 2s infinite;
    pointer-events: none;
}

.badge-active {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    animation: pulse-glow 1.5s infinite;
    pointer-events: none;
}

@keyframes pulse-subtle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 5px rgba(40, 167, 69, 0.5);
    }
    50% {
        opacity: 0.9;
        box-shadow: 0 0 15px rgba(40, 167, 69, 0.8);
    }
}

/* Icon styling - no hover effects to avoid confusion */
.icon-static {
    color: #667eea;
}

/* Entry fee styling */
.entry-fee-free {
    color: #28a745 !important;
    font-weight: bold;
}

.entry-fee-paid {
    color: #fd7e14 !important;
    font-weight: bold;
}

/* Image overlay for title */
.image-container {
    position: relative;
    overflow: hidden;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 2rem 1.5rem 1rem;
    color: white;
}

.image-overlay h5 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
}

/* Fallback for activities without image */
.no-image-container {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.no-image-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    padding: 2rem 1.5rem 1rem;
    color: white;
}

.no-image-title h5 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
}

/* Timeline styles */
.timeline-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow-x: auto;
    overflow-y: hidden;
}

/* CSS proměnná pro šířku hodiny */
:root {
    --hour-width: 100px;
    /* timeline-total-width se nastaví dynamicky přes JavaScript */
}

.timeline-header {
    display: grid;
    gap: 2px;
    margin-bottom: 1rem;
    font-weight: bold;
    font-size: 0.9rem;
    justify-content: start;
    min-width: max-content;
    /* grid-template-columns se nastaví dynamicky přes JavaScript */
}

.timeline-hour {
    text-align: center;
    padding: 0.5rem 0;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 5px;
    min-width: var(--hour-width);
    width: var(--hour-width);
}

.timeline-day {
    display: grid;
    gap: 2px;
    margin-bottom: 2rem;
    min-height: 200px;
    padding: 10px 0;
    justify-content: start;
    min-width: max-content;
    /* grid-template-columns se nastaví dynamicky přes JavaScript */
}

.day-label {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    padding: 0.5rem;
}

.timeline-grid {
    position: relative;
    grid-column: 1 / -1;
    display: grid;
    gap: 2px;
    width: 100%;
    justify-content: start;
    min-width: max-content;
    /* grid-template-columns se nastaví dynamicky přes JavaScript */
}

.timeline-slot {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    height: 100%;
    min-width: var(--hour-width);
    width: var(--hour-width);
}

.game-block {
    position: absolute;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 8px;
    padding: 0.5rem;
    font-size: 0.85rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
    height: 70px;
    overflow: hidden;
    margin: 5px 0;
    min-width: 80px;
    /* Pozice se nastaví přes JavaScript */
    left: 0;
    width: 0;
    top: 0;
}

.game-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.game-title {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.game-info {
    font-size: 0.75rem;
    opacity: 0.9;
    line-height: 1.1;
}

.game-info-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.1rem;
}

/* Game Table Modal Styles */

/* Opravíme z-index problém - backdrop musí být pod modalem */
.modal-backdrop {
    z-index: 1040 !important;
}

.modal {
    z-index: 1050 !important;
}

.modal-dialog {
    max-width: 800px;
    z-index: 1060 !important;
    position: relative !important;
}

.modal-content {
    z-index: 1070 !important;
    position: relative !important;
}

.game-table-modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    z-index: 1080 !important;
    position: relative !important;
}

/* Zajistíme, že všechny interaktivní elementy jsou klikatelné */
.modal-header,
.modal-body,
.modal-footer,
.modal-header *,
.modal-body *,
.modal-footer * {
    z-index: 1090 !important;
    position: relative !important;
    pointer-events: auto !important;
}

.game-table-modal .modal-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 1.5rem;
}

.game-table-modal .modal-title {
    font-size: 1.4rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.game-table-modal .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

.game-table-modal .btn-close:hover {
    opacity: 1;
}

.game-image-container {
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-image {
    max-height: 200px;
    object-fit: cover;
    border: 3px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.game-image:hover {
    transform: scale(1.05);
    border-color: rgba(102, 126, 234, 0.5);
}

.game-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    border: 2px dashed rgba(102, 126, 234, 0.3);
    border-radius: 15px;
    min-height: 200px;
    width: 100%;
}

.info-card {
    display: flex;
    align-items: center;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.info-card-full {
    display: flex;
    align-items: flex-start;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(102, 126, 234, 0.2);
}



.difficulty-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.difficulty-easy {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.difficulty-medium {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: #212529;
}

.difficulty-hard {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
    color: white;
}

.game-type-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.guided-game {
    background: linear-gradient(135deg, #17a2b8, #20c997);
    color: white;
}

.free-game {
    background: linear-gradient(135deg, #6f42c1, #e83e8c);
    color: white;
}

.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

a.text-decoration-none:hover .card-hover {
}

/* Responzivní úpravy */
@media (max-width: 768px) {
    .main-content {
        margin: 1rem 0;
        border-radius: 15px;
    }

    .logo span {
        font-size: 1.2rem !important;
    }

    .logo i {
        font-size: 1.5rem !important;
    }

    :root {
        --hour-width: 60px;
        --timeline-total-width: calc(24 * var(--hour-width));
    }

    .timeline-header {
        font-size: 0.8rem;
    }

    .timeline-day {
        min-height: 150px;
    }

    .timeline-slot {
        min-height: 150px;
    }

    .game-block {
        font-size: 0.75rem;
        padding: 0.4rem;
        height: 60px;
        min-width: 50px;
    }

    .day-label {
        font-size: 0.8rem;
        padding: 0.3rem;
    }

    .game-table-modal .modal-dialog {
        margin: 1rem;
    }

    .info-card {
        padding: 0.75rem;
    }

    .game-image-container {
        min-height: 150px;
    }

    .game-image {
        max-height: 150px;
    }

    .game-image-placeholder {
        min-height: 150px;
    }
}
