/* mobile.css - Optimized for Mobile 2026 */

/* Utility Classes */
.btn-primary, .btn-secondary, .btn-danger {
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    touch-action: manipulation;
    user-select: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #00cc77);
    color: #000;
}

.btn-secondary {
    background: rgba(0, 212, 255, 0.2);
    color: var(--secondary);
    border: 2px solid var(--secondary);
}

.btn-danger {
    background: rgba(255, 68, 68, 0.2);
    color: var(--danger);
    border: 2px solid var(--danger);
}

.btn-primary:active, .btn-secondary:active, .btn-danger:active {
    transform: scale(0.98);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--darker);
    border: 2px solid var(--primary);
    border-radius: 20px;
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1001;
    padding: 25px;
    animation: modalSlideIn 0.3s;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0,255,136,0.3);
}

.modal-close {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 15px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(0,255,136,0.3);
    border-radius: 10px;
    color: var(--light);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,255,136,0.1);
}

/* Chat Interface */
.chat-container {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 80vh;
    background: var(--darker);
    border-top: 2px solid var(--primary);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.chat-header {
    padding: 15px;
    background: rgba(0,20,0,0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,255,136,0.2);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: rgba(0,10,0,0.3);
}

.chat-input-area {
    padding: 15px;
    background: rgba(0,20,0,0.5);
    border-top: 1px solid rgba(0,255,136,0.2);
    display: flex;
    gap: 10px;
}

/* Game Grid */
.game-grid {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}

.block-cell {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    font-weight: bold;
}

.block-cell:hover {
    background: rgba(255,255,255,0.2);
}

.block-cell.active {
    background: var(--primary);
    color: #000;
    transform: scale(0.95);
}

/* Responsive Tables */
.responsive-table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

.glitch {
    animation: glitch 0.5s;
}

/* Touch Feedback */
.touch-feedback:active {
    background: rgba(0,255,136,0.2) !important;
}

/* Safe Area untuk iPhone X+ */
@supports(padding: max(0px)) {
    body, header, footer {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
    
    footer {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --dark: #0a0a0f;
        --darker: #050510;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary: #00ff00;
        --secondary: #00ffff;
    }
}

/* Reduce Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Landscape Mode Optimizations */
@media (orientation: landscape) and (max-height: 500px) {
    .chat-container {
        height: 100vh;
    }
    
    .modal {
        max-height: 80vh;
    }
}

/* Large Screen Optimizations */
@media (min-width: 1024px) {
    .mobile-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: none;
    }
    
    /* Desktop navigation akan ditambahkan via JS */
}