/* ==========================================================================
   6. Styly pro Tržnici AR Obsahu
   ========================================================================== */

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

/* Coin Overview */
.coin-overview {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 25px;
    color: #333;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.coin-stats {
    display: flex;
    justify-content: center;
    align-items: center;
}

.coin-display {
    display: flex;
    align-items: center;
    justify-content: center; /* ✅ PŘIDÁNO: Centrování obsahu */
    gap: 20px;
    background: rgba(255, 255, 255, 0.2);
    padding: 20px 30px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    width: 100%; /* ✅ PŘIDÁNO: Využij celou šířku */
}

.coin-icon {
    width: 80px; /* ✅ ZMĚNA: Z 60px na 80px */
    height: 80px; /* ✅ ZMĚNA: Z 60px na 80px */
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.coin-info {
    text-align: center; /* ✅ ZMĚNA: Z left na center */
}

.coin-number {
    display: block;
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

.coin-label {
    font-size: 1.1em;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* Dropdown Menu Styles - Same as inventory */
.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: #FFD700;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.3);
}

.dropdown-button.active {
    border-color: #FFD700;
    background: #fffbf0;
}

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

.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: #fffbf0;
}

.dropdown-item.active {
    background-color: #FFD700;
    color: #333;
}

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

/* Fixed Back Button - Same as inventory */
.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: #FFD700 !important;
    color: #333 !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(255, 215, 0, 0.4) !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: #FFA500 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.5) !important;
}

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

/* Shop Grid */
.shop-container {
    margin-bottom: 100px;
}

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

.shop-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;
}

.shop-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.shop-item.available::before {
    background: linear-gradient(90deg, #4CAF50, #45a049);
    opacity: 1;
}

.shop-item.purchased::before {
    background: linear-gradient(90deg, #FFD700, #FFA500);
    opacity: 1;
}

.shop-item.locked::before {
    background: linear-gradient(90deg, #f44336, #d32f2f);
    opacity: 1;
}

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

.shop-item.available:hover {
    border-color: #4CAF50;
}

.shop-item.purchased:hover {
    border-color: #FFD700;
}

.shop-item.locked {
    opacity: 0.7;
}

.shop-item.locked:hover {
    transform: translateY(-2px);
    border-color: #f44336;
}

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

.shop-item-info {
    flex: 1;
}

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

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

.shop-item-meta {
    display: flex;
    gap: 15px;
    font-size: 0.8em;
    margin-bottom: 8px;
}

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

.shop-item-category {
    color: #888;
}

.shop-item-price {
    font-weight: bold;
    font-size: 1em;
}

.shop-item-price.affordable {
    color: #4CAF50;
}

.shop-item-price.owned {
    color: #FFD700;
}

.shop-item-price.expensive {
    color: #f44336;
}

/* Coin Icon in Prices */
.price-coin-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
    margin-left: 4px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

/* Larger coin icon in modal */
.shop-item-detail .price-coin-icon {
    width: 20px;
    height: 20px;
    margin-left: 6px;
}

/* Coin icon in purchase button */
.purchase-button .price-coin-icon {
    width: 18px;
    height: 18px;
    margin-left: 5px;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

/* Coin icon fallback styling */
.price-coin-icon[alt="mince"] {
    display: inline-block;
}

/* Error fallback - show emoji if image fails */
.price-coin-icon:not([src]) {
    display: none;
}

.price-coin-icon:not([src])::after {
    content: '🪙';
    display: inline;
    font-size: 1em;
}

/* Shop Modal */
.shop-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);
}

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

.shop-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;
}

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

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

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

.shop-item-detail {
    text-align: center;
}

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

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

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

.shop-item-detail .shop-item-meta {
    justify-content: center;
    margin-bottom: 20px;
}

.shop-item-actions {
    margin-top: 25px;
}

.purchase-button, .view-button {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.purchase-button {
    background: #4CAF50;
    color: white;
}

.purchase-button:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.view-button {
    background: #FFD700;
    color: #333;
}

.view-button:hover {
    background: #FFA500;
    transform: translateY(-2px);
}

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

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

.confirm-modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

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

.confirm-modal-content h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.confirm-modal-content p {
    margin: 0 0 25px 0;
    color: #666;
}

.confirm-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-button, .cancel-button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirm-button {
    background: #4CAF50;
    color: white;
}

.confirm-button:hover {
    background: #45a049;
}

.cancel-button {
    background: #f44336;
    color: white;
}

.cancel-button:hover {
    background: #d32f2f;
}

/* Gallery Modal */
.gallery-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.gallery-modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
    position: relative;
}

.gallery-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2em;
    cursor: pointer;
    color: #999;
}

.gallery-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.gallery-item img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 10px;
}

.gallery-item p {
    text-align: center;
    color: #666;
    font-style: italic;
}

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

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

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

/* Purchase Success Animation */
@keyframes purchaseNotificationAnim {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    10% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
    }
    20% {
        transform: translate(-50%, -50%) scale(1);
    }
    90% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

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

    .shop-item {
        padding: 15px;
    }

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

    .shop-item-name {
        font-size: 1.1em;
    }

    .shop-item-description {
        font-size: 0.85em;
    }

    .coin-display {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        justify-content: center;
    }
    
    .coin-number {
        font-size: 2.5em;
    }
    
    .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-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;
    }

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

    .shop-container {
        margin-bottom: 120px;
    }
}

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

    .shop-item-info {
        width: 100%;
    }

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

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

    .dropdown-item {
        padding: 12px 15px;
        font-size: 0.9em;
    }

    .coin-overview {
        padding: 20px;
    }

    .coin-icon {
        width: 60px; /* ✅ ZMĚNA: Z 40px na 60px pro mobily */
        height: 60px; /* ✅ ZMĚNA: Z 40px na 60px pro mobily */
    }
    
    .coin-number {
        font-size: 2em;
    }
}

.shop-item.locked-achievement {
    background: #f5f5f5;
    border: 2px dashed #ccc;
    opacity: 0.8;
}

.shop-item.locked-achievement:hover {
    background: #ebebeb;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.shop-item-price.achievement-locked {
    color: #999;
    font-weight: bold;
}

.shop-item.locked-achievement .shop-item-name,
.shop-item.locked-achievement .shop-item-description {
    color: #999;
}

.shop-item.locked-achievement .shop-item-icon {
    filter: grayscale(0.7);
}

/* Disabled button styling */
button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}