@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Orbitron:wght@500;700&display=swap');

:root {
    --primary: #3a86ff;
    --primary-dark: #2667cc;
    --secondary: #8338ec;
    --accent: #ff006e;
    --dark: #0f172a;
    --dark-2: #1e293b;
    --light: #f8fafc;
    --gray: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', -apple-system, Arial, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a, #1e1b4b);
    color: var(--light);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.back-button:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-2px);
}

.back-button i {
    margin-right: 8px;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 25%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 25%);
    pointer-events: none;
    z-index: 1;
}

.container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 30px 20px;
    position: relative;
    z-index: 2;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 30px;
    background: linear-gradient(90deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
}

.display {
    width: 100%;
    padding: 25px 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 500;
    text-align: right;
    border: none;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3), 0 5px 20px rgba(0, 0, 0, 0.2);
    margin-bottom: 25px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    letter-spacing: 2px;
}

.display::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    animation: rainbow 3s linear infinite;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 10px;
}

button {
    position: relative;
    padding: 20px 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.8);
    color: var(--light);
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(58, 134, 255, 0.1), rgba(131, 56, 236, 0.1));
    opacity: 0;
    transition: var(--transition);
}

button:hover::before {
    opacity: 1;
}

button:active {
    transform: scale(0.95);
}

button:focus {
    outline: none;
}

.operator {
    background: rgba(30, 41, 59, 0.9);
    color: var(--primary);
    font-size: 1.6rem;
}

.operator:hover {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 0 20px rgba(58, 134, 255, 0.4);
}

.equals {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: #fff;
    grid-column: span 2;
    aspect-ratio: auto;
    padding: 20px 10px;
    font-size: 1.6rem;
    font-weight: 700;
    box-shadow: 0 0 25px rgba(58, 134, 255, 0.5);
}

.equals:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 35px rgba(58, 134, 255, 0.7);
}

.clear, .backspace {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.clear:hover, .backspace:hover {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.percent {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.percent:hover {
    background: var(--success);
    color: #fff;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@media (max-width: 480px) {
    .container {
        padding: 20px 15px;
        border-radius: 20px;
    }
    
    h1 {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }
    
    .display {
        font-size: 2rem;
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    button {
        padding: 18px 10px;
        font-size: 1.2rem;
    }
    
    .operator {
        font-size: 1.4rem;
    }
    
    .equals {
        font-size: 1.4rem;
    }
} 