/* ==========================================================================
   5. Styly pro Inventář Trofejí
   ========================================================================== */

/* zobrazení debug okan */
#debugPanel { display: none !important; }

/* Progress Overview */
.progress-overview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.progress-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    text-align: center;
    flex: 1;
    min-width: 120px;
}

.stat-number {
    display: block;
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Dropdown Menu Styles */
.category-dropdown {
    position: relative;
    margin-bottom: 25px;
    z-index: 100;
    display: flex;
    justify-content: center;
}

.dropdown-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 320px;
    min-width: 280px;
}

.dropdown-button:hover {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.dropdown-button.active {
    border-color: #667eea;
    background: #f8f9ff;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
    font-size: 1.2em;
    color: #667eea;
}

.dropdown-button.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 2px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    min-width: 300px;
    max-width: 450px;
    width: max-content;
    margin-top: 5px;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.dropdown-item:first-child {
    border-radius: 10px 10px 0 0;
}

.dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 10px 10px;
}

.dropdown-item:hover {
    background-color: #f8f9ff;
}

.dropdown-item.active {
    background-color: #667eea;
    color: white;
}

.dropdown-item.active:hover {
    background-color: #5a6fd8;
}

/* Fixed Back Button - Override existing styles */
.fixed-back-button {
    position: fixed !important;
    bottom: 20px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    z-index: 1000 !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    text-align: center !important;
}

.fixed-back-button .back-btn {
    padding: 15px 25px !important;
    background: #667eea !important;
    color: white !important;
    border: none !important;
    border-radius: 25px !important;
    font-size: 1.1em !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
    text-decoration: none !important;
    display: inline-block !important;
    white-space: nowrap !important;
    width: auto !important;
    margin: 0 !important;
    min-width: auto !important;
    max-width: none !important;
}

.fixed-back-button .back-btn:hover {
    background: #5a6fd8 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4) !important;
}

.fixed-back-button .back-btn:active {
    background: #5a6fd8 !important;
    transform: translateY(0) !important;
}

/* Hide original back button */
.back-button-container {
    display: none;
}

/* Achievements Grid */
.achievements-container {
    margin-bottom: 100px; /* Add space for fixed button */
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.achievement-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.achievement-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.achievement-item.unlocked::before {
    opacity: 1;
}

.achievement-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.achievement-item.unlocked:hover {
    border-color: #667eea;
}

.achievement-item.locked {
    opacity: 0.6;
    cursor: default;
}

.achievement-item.locked:hover {
    transform: none;
    border-color: transparent;
}

.achievement-icon {
    font-size: 3em;
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    margin: 0 0 8px 0;
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

.achievement-description {
    margin: 0 0 12px 0;
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
}

.achievement-meta {
    display: flex;
    gap: 15px;
    font-size: 0.8em;
}

.achievement-rarity {
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.achievement-category {
    color: #888;
}

/* Achievement Modal */
.achievement-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.achievement-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.achievement-modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.achievement-modal-overlay.visible .achievement-modal-content {
    transform: scale(1);
}

.achievement-modal-close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2em;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.achievement-modal-close-button:hover {
    color: #333;
}

.achievement-detail {
    text-align: center;
}

.achievement-icon-large {
    font-size: 4em;
    margin-bottom: 20px;
}

.achievement-detail h2 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.8em;
}

.achievement-detail p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 1.1em;
    line-height: 1.5;
}

.achievement-detail .achievement-meta {
    justify-content: center;
    margin-bottom: 15px;
}

.achievement-unlock-date {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #888;
}

/* Loading State */
.achievements-grid:empty::after {
    content: 'Načítání úspěchů...';
    display: block;
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* No achievements message */
.no-achievements {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

.no-achievements::before {
    content: '🏆';
    display: block;
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .achievements-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .achievement-item {
        padding: 15px;
    }

    .achievement-icon {
        font-size: 2.5em;
        width: 50px;
        height: 50px;
    }

    .achievement-name {
        font-size: 1.1em;
    }

    .achievement-description {
        font-size: 0.85em;
    }

    .progress-stats {
        gap: 15px;
    }

    .stat-number {
        font-size: 2em;
    }

    /* Dropdown responsive */
    .dropdown-button {
        max-width: 100%;
        min-width: auto;
        padding: 12px 15px;
    }

    .dropdown-menu {
        min-width: 100%;
        left: 0;
        transform: none;
        margin-top: 5px;
        max-width: 100%;
    }

    .dropdown-menu.visible {
        transform: none;
    }

    .dropdown-item {
        white-space: normal;
        padding: 15px 20px;
    }

    /* Fixed button responsive */
    .fixed-back-button {
        bottom: 15px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: auto !important;
        margin: 0 !important;
    }

    .fixed-back-button .back-btn {
        padding: 18px 25px !important;
        font-size: 1em !important;
        width: auto !important;
        margin: 0 !important;
    }

    .achievement-modal-content {
        padding: 30px 20px;
        margin: 20px;
    }

    .achievements-container {
        margin-bottom: 120px; /* More space on mobile */
    }
}

@media (max-width: 480px) {
    .achievement-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .achievement-info {
        width: 100%;
    }

    .achievement-meta {
        justify-content: center;
        gap: 10px;
    }

    .dropdown-button {
        font-size: 0.9em;
        padding: 10px 15px;
    }

    .dropdown-item {
        padding: 12px 15px;
        font-size: 0.9em;
    }
       /* Dropdown Menu Styles */
        .category-dropdown {
            position: relative;
            margin-bottom: 25px;
            z-index: 100;
        }

        .dropdown-button {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 15px 20px;
            background: white;
            border: 2px solid #ddd;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 1em;
            font-weight: 500;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            width: 100%;
            max-width: 300px;
            margin: 0 auto;
        }

        .dropdown-button:hover {
            border-color: #667eea;
            box-shadow: 0 5px 20px rgba(0,0,0,0.15);
        }

        .dropdown-button.active {
            border-color: #667eea;
            background: #f8f9ff;
        }

        .dropdown-arrow {
            transition: transform 0.3s ease;
            font-size: 1.2em;
            color: #667eea;
        }

        .dropdown-button.active .dropdown-arrow {
            transform: rotate(180deg);
        }

        .dropdown-menu {
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            background: white;
            border: 2px solid #ddd;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.15);
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
            z-index: 1000;
            min-width: 280px;
            max-width: 400px;
            width: max-content;
            margin-top: 5px;
        }

        .dropdown-menu.visible {
            opacity: 1;
            visibility: visible;
            transform: translateX(-50%) translateY(0);
        }

        .dropdown-item {
            padding: 12px 20px;
            cursor: pointer;
            transition: background-color 0.2s ease;
            border-bottom: 1px solid #f0f0f0;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .dropdown-item:last-child {
            border-bottom: none;
        }

        .dropdown-item:hover {
            background-color: #f8f9ff;
        }

        .dropdown-item.active {
            background-color: #667eea;
            color: white;
        }

        .dropdown-item.active:hover {
            background-color: #5a6fd8;
        }

        /* Fixed Back Button */
        .fixed-back-button {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 1000;
            box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        }

        .fixed-back-button .menu-button {
            padding: 15px 30px;
            background: #667eea;
            color: white;
            border: none;
            border-radius: 25px;
            font-size: 1.1em;
            font-weight: 500;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        }

        .fixed-back-button .menu-button:hover {
            background: #5a6fd8;
            transform: translateY(-2px);
            box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
        }

        /* Adjustments for mobile */
        @media (max-width: 768px) {
            .dropdown-button {
                max-width: 100%;
                padding: 12px 15px;
            }

            .dropdown-menu {
                min-width: 100%;
                left: 0;
                transform: none;
                margin-top: 5px;
            }

            .dropdown-menu.visible {
                transform: none;
            }

            .fixed-back-button {
                bottom: 15px;
                left: 15px;
                right: 15px;
                transform: none;
            }

            .fixed-back-button .menu-button {
                width: 100%;
                text-align: center;
            }
        }

        /* Add some bottom padding to prevent content from being hidden behind fixed button */
        .achievements-container {
            margin-bottom: 100px;
        }

        /* Hide original back button */
        .back-button-container {
            display: none;
        }
}
