/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    background: #1a1a2e;
    min-height: 100vh;
    position: relative;
}

/* Top Navigation */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.balance {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.balance i {
    color: #ffd700;
}

.profile {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.wallet-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.wallet-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Categories */
.categories {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.categories::-webkit-scrollbar {
    display: none;
}

.category {
    min-width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
    position: relative;
}

.category.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.category:hover {
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    padding: 20px;
    padding-bottom: 100px;
}

.cases-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.case-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.case-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.case-card:hover::before {
    opacity: 1;
}

.case-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.case-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.case-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.case-number {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.case-visual {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    position: relative;
    z-index: 2;
}

.case-box {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.currency-box {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.gifts-box {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
}

.free-box {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    box-shadow: 0 0 30px rgba(78, 205, 196, 0.5);
}

.coins-animation, .gifts-animation, .free-animation {
    display: flex;
    gap: 5px;
    animation: float 2s ease-in-out infinite;
}

.coins-animation i, .gifts-animation i, .free-animation i {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.9);
    animation: bounce 1.5s ease-in-out infinite;
}

.coins-animation i:nth-child(2) {
    animation-delay: 0.2s;
}

.coins-animation i:nth-child(3) {
    animation-delay: 0.4s;
}

.gifts-animation i:nth-child(2) {
    animation-delay: 0.3s;
}

.gifts-animation i:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.case-info {
    text-align: center;
    position: relative;
    z-index: 2;
}

.case-info p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
    font-size: 14px;
}

.open-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    width: 100%;
    font-size: 14px;
}

.open-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.open-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.free-btn {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #4ecdc4;
    font-size: 12px;
    margin-bottom: 10px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 60px;
}

.nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.nav-item i {
    font-size: 18px;
}

.nav-item span {
    font-size: 10px;
    font-weight: 500;
}

.beta {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff6b6b;
    color: white;
    font-size: 8px;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: #ffffff;
    font-size: 24px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #ffffff;
}

.modal-body {
    text-align: center;
    margin-bottom: 20px;
}

.reward-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.reward-icon {
    font-size: 60px;
    animation: rewardBounce 1s ease-in-out;
}

.reward-text {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

@keyframes rewardBounce {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.modal-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    width: 100%;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Inventory Grid */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.inventory-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.inventory-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.inventory-item i {
    font-size: 30px;
    margin-bottom: 10px;
    display: block;
}

.inventory-item .item-name {
    font-size: 12px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 5px;
}

.inventory-item .item-quantity {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive Design */
@media (max-width: 480px) {
    .app-container {
        max-width: 100%;
    }
    
    .top-nav {
        padding: 10px 15px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .case-box {
        width: 100px;
        height: 100px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 20px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success Animation */
.success-animation {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
