/* Sentry-inspired Calculator Styles */

:root {
    /* Sentry Color Palette */
    --sentry-purple-100: #f7f5ff;
    --sentry-purple-200: #ede8ff;
    --sentry-purple-300: #d6ccff;
    --sentry-purple-400: #b8a4ff;
    --sentry-purple-500: #9a7aff;
    --sentry-purple-600: #7c5dfa;
    --sentry-purple-700: #6344c7;
    --sentry-purple-800: #4a2d94;
    --sentry-purple-900: #2d1b69;

    /* Dark Theme Colors */
    --sentry-gray-100: #f8f9fa;
    --sentry-gray-200: #e9ecef;
    --sentry-gray-300: #dee2e6;
    --sentry-gray-400: #ced4da;
    --sentry-gray-500: #adb5bd;
    --sentry-gray-600: #6c757d;
    --sentry-gray-700: #495057;
    --sentry-gray-800: #343a40;
    --sentry-gray-900: #212529;

    /* Background Colors */
    --bg-primary: #1a1625;
    --bg-secondary: #241e35;
    --bg-tertiary: #2d2640;
    --bg-card: #322b47;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #c4b5fd;
    --text-muted: #9ca3af;

    /* Accent Colors */
    --accent-primary: var(--sentry-purple-500);
    --accent-hover: var(--sentry-purple-400);
    --accent-active: var(--sentry-purple-600);

    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header Styles */
.header {
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.logo svg {
    color: var(--accent-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
}

/* Calculator Styles */
.calculator {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 400px;
}

/* Display Styles */
.display-container {
    margin-bottom: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.display {
    text-align: right;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.previous-operand {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    min-height: 1.5rem;
    opacity: 0.7;
}

.current-operand {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--text-primary);
    word-wrap: break-word;
    word-break: break-all;
    line-height: 1.2;
}

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

/* Button Base Styles */
.btn {
    height: 60px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    font-family: inherit;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: scale(0.95);
}

/* Number Buttons */
.btn-number {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-number:hover {
    background: var(--bg-secondary);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Zero Button (spans 2 columns) */
.btn-zero {
    grid-column: span 2;
}

/* Function Buttons (AC, Delete, %) */
.btn-function {
    background: var(--sentry-gray-700);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-function:hover {
    background: var(--sentry-gray-600);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Operator Buttons */
.btn-operator {
    background: var(--accent-primary);
    color: white;
    border: 1px solid var(--accent-primary);
    font-weight: 600;
}

.btn-operator:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-operator:active {
    background: var(--accent-active);
    border-color: var(--accent-active);
}

/* Equals Button */
.btn-equals {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-hover) 100%);
    color: white;
    border: 1px solid var(--accent-primary);
    font-weight: 600;
    font-size: 1.5rem;
}

.btn-equals:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent-primary) 100%);
    box-shadow: 0 4px 12px rgba(154, 122, 255, 0.3);
}

/* Footer */
.footer {
    padding: 2rem 0 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes buttonPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.btn.pressed {
    animation: buttonPress 150ms ease-in-out;
}

/* Responsive Design */
@media (max-width: 480px) {
    .app-container {
        padding: 0 0.5rem;
    }

    .calculator {
        padding: 1.5rem;
        margin: 1rem 0;
    }

    .current-operand {
        font-size: 2rem;
    }

    .btn {
        height: 55px;
        font-size: 1.125rem;
    }

    .buttons-grid {
        gap: 0.5rem;
    }
}

@media (max-width: 360px) {
    .current-operand {
        font-size: 1.75rem;
    }

    .btn {
        height: 50px;
        font-size: 1rem;
    }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    }
}

/* Focus styles for accessibility */
.btn:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border-width: 2px;
    }
    
    .calculator {
        border-width: 2px;
    }
}

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