/* =============== MENU UTAMA SCREEN - MODERN & KIDS-FRIENDLY =============== */
#menuScreen {
    background: var(--white);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* HEADER - 10% TINGGI */
.menu-header {
    text-align: center;
    position: relative;
    z-index: 2;
    flex: 0 0 10vh; /* 10% tinggi viewport */
    min-height: 70px;
    max-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(145deg, #4D96FF, #6BCBFF);
    backdrop-filter: blur(15px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    padding: 10px 15px;
}

.menu-header h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 900;
    margin-bottom: 5px;
    background: var(--warning-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-border: white;
    letter-spacing: -0.5px;
    animation: titleGlow 3s infinite alternate ease-in-out;
}

@keyframes titleGlow {
    0% {
        filter: drop-shadow(0 2px 4px rgba(255, 107, 107, 0.3));
    }
    50% {
        filter: drop-shadow(0 2px 6px rgba(255, 217, 61, 0.4));
    }
    100% {
        filter: drop-shadow(0 2px 4px rgba(107, 207, 127, 0.3));
    }
}

/* OPERATION CONTAINER - 85% TINGGI */
.operation-container {
    flex: 1; /* Mengisi ruang antara header dan footer */
    display: flex;
    flex-direction: column;
    padding: 15px;
    position: relative;
    z-index: 2;
    min-height: 0;
    overflow: hidden;
    height: 80vh;
}

.operation-selection {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.25);
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    min-height: 0;
    overflow: hidden;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
}

.operation-selection::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        #FF6B6B, 
        #FFD93D, 
        #6BCF7F, 
        #4D96FF, 
        #9D4BFF);
    border-radius: 20px 20px 0 0;
}

.operation-title {
    font-size: clamp(1rem, 2.2vw, 1.3rem);
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 10px;
}

.operation-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #FFD93D, transparent);
    border-radius: 2px;
}

/* GRID - MODERN LAYOUT */
.operations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 15px;
    flex: 1;
    min-height: 0;
    height: 100%;
}

/* CARDS - OPTIMIZED FOR HEIGHT */
.operation-card {
    border-radius: 16px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 3px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* GRADIENTS - MODERN COLOR PALETTE */
.operation-card:nth-child(1) { 
    background: linear-gradient(145deg, #FF6B6B, #FF8E8E);
    border-color: rgba(255, 107, 107, 0.3);
}
.operation-card:nth-child(2) { 
    background: linear-gradient(145deg, #FFD93D, #FFE566);
    border-color: rgba(255, 217, 61, 0.3);
}
.operation-card:nth-child(3) { 
    background: linear-gradient(145deg, #6BCF7F, #8DE99E);
    border-color: rgba(107, 207, 127, 0.3);
}
.operation-card:nth-child(4) { 
    background: linear-gradient(145deg, #4D96FF, #6BCBFF);
    border-color: rgba(77, 150, 255, 0.3);
}
.operation-card:nth-child(5) { 
    background: linear-gradient(145deg, #9D4BFF, #B88CFF);
    border-color: rgba(157, 75, 255, 0.3);
}
.operation-card:nth-child(6) { 
    background: linear-gradient(145deg, #FF6B9D, #FF8EBB);
    border-color: rgba(255, 107, 157, 0.3);
}
.operation-card:nth-child(7) { 
    background: linear-gradient(145deg, #FFB347, #FFCC66);
    border-color: rgba(255, 179, 71, 0.3);
}
.operation-card:nth-child(8) { 
    background: linear-gradient(145deg, #00D4AA, #5CE6C4);
    border-color: rgba(0, 212, 170, 0.3);
}
.operation-card:nth-child(9) { 
    background: linear-gradient(145deg, #667eea, #8A9CFF);
    border-color: rgba(102, 126, 234, 0.3);
}
.operation-card:nth-child(10) { 
    background: linear-gradient(145deg, #FF9551, #FFB347);
    border-color: rgba(255, 149, 81, 0.3);
}
.operation-card:nth-child(11) { 
    background: linear-gradient(145deg, #00C9B7, #00E4D1);
    border-color: rgba(0, 201, 183, 0.3);
}
.operation-card:nth-child(12) { 
    background: linear-gradient(145deg, #A78BFA, #C4B5FD);
    border-color: rgba(167, 139, 250, 0.3);
}

/* CARD HOVER EFFECT - Premium Glow */
.operation-card:hover {
    transform: translateY(-10px) scale(1.05) rotate(1deg);
    color: #000000 !important;
    text-shadow: 
        1px 1px 0 #FFFFFF,
        -1px -1px 0 #FFFFFF,
        1px -1px 0 #FFFFFF,
        -1px 1px 0 #FFFFFF,
        0 0 20px var(--card-glow-color, rgba(255, 217, 61, 0.7)) !important;
    font-weight: 900 !important;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.3),
        0 0 40px var(--card-glow-color, rgba(255, 255, 255, 0.4)),
        inset 0 0 20px rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.8);
    z-index: 100;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: brightness(1.1) contrast(1.05);
}

/* Custom glow colors for each card */
.operation-card:nth-child(1):hover { --card-glow-color: rgba(255, 107, 107, 0.5); }
.operation-card:nth-child(2):hover { --card-glow-color: rgba(255, 217, 61, 0.5); }
.operation-card:nth-child(3):hover { --card-glow-color: rgba(107, 207, 127, 0.5); }
.operation-card:nth-child(4):hover { --card-glow-color: rgba(77, 150, 255, 0.5); }
.operation-card:nth-child(5):hover { --card-glow-color: rgba(157, 75, 255, 0.5); }
.operation-card:nth-child(6):hover { --card-glow-color: rgba(255, 107, 157, 0.5); }
.operation-card:nth-child(7):hover { --card-glow-color: rgba(255, 179, 71, 0.5); }
.operation-card:nth-child(8):hover { --card-glow-color: rgba(0, 212, 170, 0.5); }
.operation-card:nth-child(9):hover { --card-glow-color: rgba(102, 126, 234, 0.5); }
.operation-card:nth-child(10):hover { --card-glow-color: rgba(255, 149, 81, 0.5); }
.operation-card:nth-child(11):hover { --card-glow-color: rgba(0, 201, 183, 0.5); }
.operation-card:nth-child(12):hover { --card-glow-color: rgba(167, 139, 250, 0.5); }


/* ==== TEXT STYLING ON HOVER - ADD THESE ==== */

/* Icon styling on hover - BLACK WITH WHITE OUTLINE */
.operation-card:hover .operation-icon {
    color: #000000 !important;
    text-shadow: 
        1px 1px 0 #FFFFFF,
        -1px -1px 0 #FFFFFF,
        1px -1px 0 #FFFFFF,
        -1px 1px 0 #FFFFFF,
        0 0 20px var(--card-glow-color, rgba(255, 217, 61, 0.7)) !important;
    font-weight: 900 !important;
    transform: scale(1.15) rotate(5deg);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
}

/* Text styling on hover - BLACK WITH WHITE OUTLINE */
.operation-card:hover .operation-name {
    color: #000000 !important;
    text-shadow: 
        1px 1px 0 #FFFFFF,
        -1px -1px 0 #FFFFFF,
        1px -1px 0 #FFFFFF,
        -1px 1px 0 #FFFFFF,
        0 0 15px var(--card-glow-color, rgba(255, 217, 61, 0.6)) !important;
    font-weight: 900 !important;
    letter-spacing: 0.3px;
    transition: all 0.3s ease !important;
}

/* Highlight angka dalam nama - DIFFERENT COLOR */
.operation-card:hover .operation-name .number {
    color: #FF6B6B !important; /* Merah untuk kontras */
    text-shadow: 
        2px 2px 0 #FFFFFF,
        -2px -2px 0 #FFFFFF,
        2px -2px 0 #FFFFFF,
        -2px 2px 0 #FFFFFF,
        0 0 25px rgba(255, 107, 107, 0.8) !important;
    font-weight: 1000 !important;
    font-size: 1.1em;
}

/* SELECTED CARD - Simple Zoom */
.operation-card.selected {
    border: 3px solid #4D96FF;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(77, 150, 255, 0.4);
    transform: scale(1.12);
    z-index: 200;
    transition: all 0.3s ease;
}

.operation-card.selected .operation-icon {
    transform: scale(1.2);
    color: #4D96FF;
    transition: all 0.3s ease;
}

.operation-card.selected .operation-name {
    color: #333333;
    font-weight: 800;
}

/* ICON STYLING */
.operation-icon {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 800;
    margin-bottom: 3px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.operation-card:hover .operation-icon {
    transform: scale(1.1);
}

/* NAMA OPERASI - SATU KALIMAT UTUH */
.operation-name {
    font-size: clamp(0.8rem, 1.8vw, 1rem);
    font-weight: 700;
    line-height: 1.2;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    padding: 0 5px;
    word-break: break-word;
}

/* Highlight angka dalam nama */
.operation-name .number {
    color: #FFD93D;
    font-weight: 900;
}

/* FOOTER - 5% TINGGI */
.menu-footer {
    flex: 0 0 10vh; /* 5% tinggi viewport */
    min-height: 50px;
    max-height: 70px;
    padding: 10px 15px;
    position: relative;
    z-index: 2;
    text-align: center;
    background: linear-gradient(45deg, 
        rgba(77, 150, 255, 0.9), 
        rgba(107, 207, 127, 0.9));
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.15);
}

.developer-text {
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    color: white;
    font-weight: 600;
    margin-bottom: 5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.developer-link {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 16px;
    border-radius: 15px;
    text-decoration: none;
    font-weight: 600;
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.developer-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* =============== RESPONSIVE DESIGN =============== */

/* Tablet */
@media (max-width: 1024px) {
    .menu-header {
        flex: 0 0 12vh;
        min-height: 65px;
    }
    
    .operation-container {
        height: 83vh;
        padding: 12px;
    }
    
    .operation-selection {
        padding: 15px;
    }
    
    .operations-grid {
        gap: 12px;
    }
    
    .operation-card {
        padding: 12px 8px;
        gap: 6px;
    }
    
    .menu-footer {
        flex: 0 0 10vh;
        min-height: 45px;
    }
}

/* Mobile Portrait */
@media (max-width: 768px) {
    .menu-header {
        flex: 0 0 15vh;
        min-height: 60px;
        padding: 8px 12px;
    }
    
    .menu-header h1 {
        font-size: 1.4rem;
    }
    
    .operation-container {
        height: 80vh;
        padding: 10px;
    }
    
    .operation-selection {
        padding: 12px;
        border-radius: 16px;
    }
    
    .operation-title {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .operations-grid {
        gap: 10px;
    }
    
    .operation-card {
        padding: 10px 6px;
        border-radius: 12px;
        gap: 5px;
    }
    
    .operation-icon {
        font-size: 1.2rem;
    }
    
    .operation-name {
        font-size: 0.75rem;
    }
    
    .menu-footer {
        flex: 0 0 10vh;
        min-height: 40px;
        padding: 8px 12px;
    }
}

/* Mobile Landscape */
@media (max-width: 768px) and (orientation: landscape) {
    .menu-header {
        flex: 0 0 20vh;
        min-height: 55px;
        padding: 6px 10px;
    }
    
    .menu-header h1 {
        font-size: 1.2rem;
    }
    
    .operation-container {
        height: 75vh;
        padding: 8px;
    }
    
    .operations-grid {
        gap: 8px;
    }
    
    .operation-card {
        padding: 8px 5px;
        gap: 4px;
    }
    
    .operation-icon {
        font-size: 1rem;
    }
    
    .operation-name {
        font-size: 0.7rem;
    }
    
    .menu-footer {
        flex: 0 0 10vh;
        min-height: 35px;
        padding: 6px 10px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .menu-header {
        flex: 0 0 18vh;
    }
    
    .operation-container {
        height: 77vh;
    }
    
    .operations-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, 1fr);
        gap: 8px;
    }
    
    .operation-card:nth-child(9) {
        grid-column: span 2;
        max-width: 160px;
        justify-self: center;
    }
    
    .operation-card {
        padding: 8px 4px;
        gap: 4px;
    }
    
    .menu-footer {
        flex: 0 0 10vh;
    }
}

/* Very Small Height */
@media (max-height: 600px) {
    .menu-header {
        flex: 0 0 12vh;
        min-height: 50px;
    }
    
    .menu-header h1 {
        font-size: 1.2rem;
        margin-bottom: 3px;
    }
    
    .operation-container {
        height: 83vh;
        padding: 8px;
    }
    
    .operations-grid {
        gap: 6px;
    }
    
    .operation-card {
        padding: 6px 3px;
        gap: 3px;
    }
    
    .menu-footer {
        flex: 0 0 10vh;
        min-height: 30px;
        padding: 5px 8px;
    }
}

/* Loading Animation */
/* Elegant Flip - 1.5 Seconds */
.operation-card {
    opacity: 0;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    animation: elegantFlip 1.5s ease-out forwards;
}

/* Sequential dari kiri atas ke kanan bawah */
.operation-card:nth-child(1) { animation-delay: 0s; }
.operation-card:nth-child(2) { animation-delay: 0.12s; }
.operation-card:nth-child(3) { animation-delay: 0.24s; }
.operation-card:nth-child(4) { animation-delay: 0.12s; }
.operation-card:nth-child(5) { animation-delay: 0.24s; }
.operation-card:nth-child(6) { animation-delay: 0.36s; }
.operation-card:nth-child(7) { animation-delay: 0.24s; }
.operation-card:nth-child(8) { animation-delay: 0.36s; }
.operation-card:nth-child(9) { animation-delay: 0.48s; }
.operation-card:nth-child(10) { animation-delay: 0.36s; }
.operation-card:nth-child(11) { animation-delay: 0.48s; }
.operation-card:nth-child(12) { animation-delay: 0.60s; }


@keyframes elegantFlip {
    0% {
        opacity: 0;
        transform: perspective(1200px) rotateY(90deg) rotateX(20deg) scale(0.7);
        filter: blur(2px);
    }
    15% {
        opacity: 0.3;
        transform: perspective(1200px) rotateY(-20deg) rotateX(15deg) scale(0.9);
        filter: blur(1px);
    }
    30% {
        opacity: 0.6;
        transform: perspective(1200px) rotateY(15deg) rotateX(10deg) scale(1.1);
        filter: blur(0.5px);
    }
    45% {
        opacity: 0.8;
        transform: perspective(1200px) rotateY(-8deg) rotateX(5deg) scale(0.95);
        filter: blur(0px);
    }
    60% {
        opacity: 0.9;
        transform: perspective(1200px) rotateY(5deg) rotateX(3deg) scale(1.05);
    }
    75% {
        opacity: 0.95;
        transform: perspective(1200px) rotateY(-3deg) rotateX(2deg) scale(0.98);
    }
    85% {
        opacity: 0.98;
        transform: perspective(1200px) rotateY(2deg) rotateX(1deg) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: perspective(1200px) rotateY(0deg) rotateX(0deg) scale(1);
    }
}