/**
 * Numerological Energy Application Styles
 * Mobile-first approach with CSS custom properties
 */

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
    /* Number colors - each number has its own color */
    --number-1: #e74c3c; /* Red - Leadership, Fire */
    --number-2: #3498db; /* Blue - Harmony, Water */
    --number-3: #f39c12; /* Orange - Creativity, Sun */
    --number-4: #27ae60; /* Green - Stability, Earth */
    --number-5: #9b59b6; /* Purple - Change, Spirit */
    --number-6: #e91e63; /* Pink - Love, Heart */
    --number-7: #00bcd4; /* Cyan - Wisdom, Sky */
    --number-8: #795548; /* Brown - Power, Material */
    --number-9: #607d8b; /* Blue Grey - Completion, Universe */

    /* Base colors */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ==========================================================================
   Loading Overlay
   ========================================================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.spinner-wrapper {
    text-align: center;
}

.loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
}

.card-header {
    border-bottom: none;
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.result-card {
    animation: slideInUp 0.5s ease forwards;
}

/* ==========================================================================
   Number Circles
   ========================================================================== */

.number-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.number-circle:hover {
    transform: scale(1.05);
}

/* Large circle for main results */
.number-circle-lg {
    width: 120px;
    height: 120px;
    font-size: 3rem;
}

/* Small circle for calculation display */
.number-circle-sm {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
}

/* Number-specific colors */
.number-circle[data-number="1"] { background: var(--number-1); box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4); }
.number-circle[data-number="2"] { background: var(--number-2); box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4); }
.number-circle[data-number="3"] { background: var(--number-3); box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4); }
.number-circle[data-number="4"] { background: var(--number-4); box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4); }
.number-circle[data-number="5"] { background: var(--number-5); box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4); }
.number-circle[data-number="6"] { background: var(--number-6); box-shadow: 0 4px 15px rgba(233, 30, 99, 0.4); }
.number-circle[data-number="7"] { background: var(--number-7); box-shadow: 0 4px 15px rgba(0, 188, 212, 0.4); }
.number-circle[data-number="8"] { background: var(--number-8); box-shadow: 0 4px 15px rgba(121, 85, 72, 0.4); }
.number-circle[data-number="9"] { background: var(--number-9); box-shadow: 0 4px 15px rgba(96, 125, 139, 0.4); }

.number-value {
    line-height: 1;
}

/* ==========================================================================
   Keywords/Tags
   ========================================================================== */

.badge-keyword {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.badge-keyword:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

.form-control-lg,
.form-select-lg {
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    padding: 0.875rem 2rem;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ==========================================================================
   Calculation Explanation
   ========================================================================== */

.calculation-explanation {
    background: #f8f9fa;
    margin: -1.5rem;
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 0 0 1rem 1rem;
}

.calculation-box {
    padding: 0.5rem;
}

#calculation-formula {
    font-size: 1rem;
    color: #495057;
}

/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
    border: none;
    border-radius: 0.75rem;
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
}

.alert-danger {
    background: rgba(231, 76, 60, 0.1);
    color: #c0392b;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Tablet (768px and up) */
@media (min-width: 768px) {
    .number-circle-lg {
        width: 140px;
        height: 140px;
        font-size: 3.5rem;
    }

    .number-circle-sm {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .card-header {
        padding: 1.5rem 2rem;
    }

    .card-body {
        padding: 2rem;
    }

    h1.display-5 {
        font-size: 2.5rem;
    }
}

/* Desktop (992px and up) */
@media (min-width: 992px) {
    .number-circle-lg {
        width: 160px;
        height: 160px;
        font-size: 4rem;
    }

    .calculation-explanation {
        padding: 2rem;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hide elements visually but keep them accessible */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==========================================================================
   Dark Mode Support (Optional)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
        color: #e4e4e4;
    }

    .card {
        background: #1f2937;
        color: #e4e4e4;
    }

    .form-control,
    .form-select {
        background: #374151;
        border-color: #4b5563;
        color: #e4e4e4;
    }

    .text-muted {
        color: #9ca3af !important;
    }

    .calculation-explanation {
        background: #111827;
    }
    */
}

/* ==========================================================================
   Install App Banner
   ========================================================================== */

.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    animation: slideInUp 0.4s ease;
}

.install-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.install-banner-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Mobile adjustments for install banner */
@media (max-width: 575.98px) {
    .install-banner .d-flex {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .install-banner-icon {
        width: 56px;
        height: 56px;
    }

    .install-banner-buttons {
        width: 100%;
        justify-content: center;
    }

    .install-banner-buttons .btn {
        flex: 1;
    }
}

/* ==========================================================================
   iOS Install Modal
   ========================================================================== */

#ios-install-modal .modal-content {
    border: none;
    border-radius: 1rem;
}

.ios-install-steps {
    padding: 1rem 0;
}

.ios-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 0.75rem;
}

.ios-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.ios-step-text {
    font-size: 0.95rem;
    color: #333;
}

/* Add padding at bottom when install banner is visible */
body.install-banner-visible {
    padding-bottom: 100px;
}

@media (max-width: 575.98px) {
    body.install-banner-visible {
        padding-bottom: 180px;
    }
}
