/**
 * Tika Calculator Styles
 * Modern synthetic aesthetic with translucent panels and glowing effects
 */

/* Reset and Base Styles */
.tika-calc-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    margin: 2rem 0;
}

.tika-calc-container {
    width: 100%;
    max-width: 380px;
    background: rgba(15, 15, 25, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tika-calc-container:hover {
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(139, 92, 246, 0.3),
        0 0 40px rgba(139, 92, 246, 0.15);
    transform: translateY(-2px);
}

/* Display Area */
.tika-calc-display {
    background: rgba(248, 250, 252, 0.95);
    border-radius: 16px;
    padding: 1.5rem 1.25rem;
    margin-bottom: 1.5rem;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.5rem;
    border: 1px solid rgba(139, 92, 246, 0.25);
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.05),
        0 0 20px rgba(139, 92, 246, 0.15);
    transition: all 0.3s ease;
}

.tika-calc-display:hover {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.05),
        0 0 30px rgba(139, 92, 246, 0.2);
}

.tika-calc-previous {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    color: rgba(100, 70, 180, 0.7);
    text-align: right;
    min-height: 1.2rem;
    word-wrap: break-word;
    word-break: break-all;
    transition: all 0.2s ease;
}

.tika-calc-current {
    font-family: 'Courier New', Courier, monospace;
    font-size: 2.25rem;
    font-weight: 400;
    color: #1e293b;
    text-align: right;
    word-wrap: break-word;
    word-break: break-all;
    text-shadow: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tika-calc-current.tika-animate {
    transform: scale(1.05);
    color: #6b46c1;
}

/* Button Grid */
.tika-calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

/* Base Button Styles */
.tika-btn {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.25rem;
    font-weight: 400;
    padding: 1.25rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(30, 30, 45, 0.8);
    color: #e2e8f0;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    outline: none;
    position: relative;
    overflow: hidden;
}

.tika-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.tika-btn:active::before {
    width: 300px;
    height: 300px;
}

.tika-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.15);
}

.tika-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 
        0 1px 4px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Number Buttons */
.tika-btn-number {
    background: rgba(40, 40, 60, 0.7);
    color: #f1f5f9;
}

.tika-btn-number:hover {
    background: rgba(50, 50, 75, 0.85);
    box-shadow: 
        0 4px 16px rgba(139, 92, 246, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 20px rgba(139, 92, 246, 0.15);
}

/* Operator Buttons */
.tika-btn-operator {
    background: rgba(139, 92, 246, 0.25);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.tika-btn-operator:hover {
    background: rgba(139, 92, 246, 0.4);
    color: #e9d5ff;
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 
        0 4px 16px rgba(139, 92, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 30px rgba(139, 92, 246, 0.2);
}

/* Clear Button */
.tika-btn-clear {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.tika-btn-clear:hover {
    background: rgba(239, 68, 68, 0.35);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 
        0 4px 16px rgba(239, 68, 68, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 30px rgba(239, 68, 68, 0.2);
}

/* Equals Button */
.tika-btn-equals {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.6), rgba(167, 139, 250, 0.6));
    color: #ffffff;
    font-weight: 600;
    border: 1px solid rgba(139, 92, 246, 0.5);
}

.tika-btn-equals:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.8), rgba(167, 139, 250, 0.8));
    box-shadow: 
        0 4px 20px rgba(139, 92, 246, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 40px rgba(139, 92, 246, 0.3);
}

/* Zero Button Spans Two Columns */
.tika-btn-zero {
    grid-column: span 2;
}

/* Animation Classes */
@keyframes tika-glow-pulse {
    0%, 100% {
        box-shadow: 
            0 4px 16px rgba(139, 92, 246, 0.3),
            0 0 30px rgba(139, 92, 246, 0.2);
    }
    50% {
        box-shadow: 
            0 4px 20px rgba(139, 92, 246, 0.5),
            0 0 50px rgba(139, 92, 246, 0.3);
    }
}

.tika-calc-display.tika-active {
    animation: tika-glow-pulse 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 480px) {
    .tika-calc-container {
        max-width: 100%;
        padding: 1.25rem;
        border-radius: 20px;
    }

    .tika-calc-display {
        padding: 1.25rem 1rem;
        min-height: 90px;
    }

    .tika-calc-current {
        font-size: 1.875rem;
    }

    .tika-calc-previous {
        font-size: 0.875rem;
    }

    .tika-btn {
        padding: 1rem;
        font-size: 1.125rem;
        border-radius: 10px;
    }

    .tika-calc-buttons {
        gap: 0.625rem;
    }
}

@media (max-width: 360px) {
    .tika-calc-wrapper {
        padding: 1.5rem 0.5rem;
    }

    .tika-calc-container {
        padding: 1rem;
    }

    .tika-calc-current {
        font-size: 1.625rem;
    }

    .tika-btn {
        padding: 0.875rem;
        font-size: 1rem;
    }

    .tika-calc-buttons {
        gap: 0.5rem;
    }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .tika-calc-container {
        background: rgba(10, 10, 18, 0.9);
    }
}

/* Accessibility - Focus States */
.tika-btn:focus-visible {
    outline: 2px solid rgba(139, 92, 246, 0.8);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .tika-calc-wrapper {
        break-inside: avoid;
    }
}
