/* Unit Converter Master - Premium Glassmorphism Theme */
:root {
    --cyan-primary: #22d3ee;
    --cyan-light: #67e8f9;
    --indigo-primary: #6366f1;
    --violet-primary: #8b5cf6;
    --slate-bg: #0b0f1a;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 12px 48px 0 rgba(0, 0, 0, 0.4);
}

/* Base Overrides */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' %3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

/* Glassmorphism Classes */
.bento-tile {
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 2rem;
    border: 1px solid var(--glass-border);
    padding: 2.25rem;
    box-shadow: var(--glass-shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.bento-tile:hover {
    border-color: rgba(34, 211, 238, 0.3);
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 24px 64px -12px rgba(34, 211, 238, 0.15);
}

.input-glass,
.select-glass {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.125rem;
    color: white;
    padding: 1.125rem 1.25rem;
    width: 100%;
    transition: all 0.3s ease;
    outline: none;
    font-size: 1rem;
    font-weight: 500;
}

.input-glass:focus,
.select-glass:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--cyan-primary);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

.swap-btn {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--cyan-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    cursor: pointer;
    transition: all 0.4s ease;
}

.swap-btn:hover {
    background: var(--cyan-primary);
    color: var(--slate-bg);
    transform: rotate(180deg);
}

/* History Drawer Controls */
#historyDrawer.active {
    transform: translateX(0);
}

.history-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 1.5rem;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(34, 211, 238, 0.2);
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Animations */
@keyframes card-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.bento-tile {
    animation: card-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.bento-tile:nth-child(2) {
    animation-delay: 0.1s;
}

.bento-tile:nth-child(3) {
    animation-delay: 0.15s;
}

.bento-tile:nth-child(4) {
    animation-delay: 0.2s;
}

.bento-tile:nth-child(5) {
    animation-delay: 0.25s;
}

.bento-tile:nth-child(6) {
    animation-delay: 0.3s;
}

/* Desktop Mouse Tracking Glow */
@media (min-width: 1024px) {
    .bento-tile::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y), rgba(34, 211, 238, 0.08), transparent 40%);
        opacity: 0;
        transition: opacity 0.5s;
        z-index: 1;
        pointer-events: none;
    }

    .bento-tile:hover::before {
        opacity: 1;
    }
}

/* Hide Spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}