/* Custom CSS for Loshu Numerology Calculator */

/* Grid Cell Styles */
.grid-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border: 2px solid #d0d0d0;
    color: #9e9e9e;
    letter-spacing: 0.1em;
}

.grid-cell.active {
    background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
    color: white;
    border-color: #7e22ce;
    box-shadow: 0 4px 6px -1px rgba(147, 51, 234, 0.3), 0 2px 4px -1px rgba(147, 51, 234, 0.2);
    transform: scale(1.05);
    animation: pulse 2s infinite;
}

.grid-cell.empty {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
    border-color: #f59e0b;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 6px -1px rgba(147, 51, 234, 0.3), 0 2px 4px -1px rgba(147, 51, 234, 0.2);
    }
    50% {
        box-shadow: 0 8px 12px -2px rgba(147, 51, 234, 0.4), 0 4px 8px -2px rgba(147, 51, 234, 0.3);
    }
}

/* Responsive Grid */
@media (max-width: 640px) {
    .grid-cell {
        font-size: 1.25rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #9333ea 0%, #7e22ce 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #7e22ce 0%, #6b21a8 100%);
}

/* Card Hover Effects */
.bg-white {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bg-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Input Focus Effects */
input:focus, select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

/* Button Hover Effects */
button {
    transition: all 0.3s ease;
}

button:active {
    transform: scale(0.98);
}

/* Navigation Link Hover */
nav a {
    position: relative;
    transition: color 0.3s ease;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #9333ea 0%, #7e22ce 100%);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Number Badge Styles */
.number-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.25rem;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(90deg, #9333ea 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(147, 51, 234, 0.1);
    border-top: 3px solid #9333ea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltip Styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.875rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Print Styles */
@media print {
    nav, footer, button {
        display: none;
    }
    
    .bg-gradient-to-br {
        background: white;
    }
    
    body {
        background: white;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .text-4xl {
        font-size: 2rem;
    }
    
    .text-5xl {
        font-size: 2.5rem;
    }
    
    nav .flex {
        flex-direction: column;
        align-items: flex-start;
    }
    
    nav .space-x-4 {
        margin-top: 1rem;
        width: 100%;
    }
    
    nav a {
        display: block;
        width: 100%;
        padding: 0.75rem 1rem;
    }
}

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

/* Focus Visible for Keyboard Navigation */
*:focus-visible {
    outline: 2px solid #9333ea;
    outline-offset: 2px;
}

/* Custom Radio/Checkbox Styles */
input[type="radio"]:checked,
input[type="checkbox"]:checked {
    accent-color: #9333ea;
}

/* Card Shadows */
.card-shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Letter Breakdown Cards */
.letter-card {
    transition: transform 0.2s ease;
}

.letter-card:hover {
    transform: translateY(-3px);
}

/* Result Cards Animation */
#resultsSection > div {
    animation: fadeIn 0.6s ease-out;
}

#resultsSection > div:nth-child(1) { animation-delay: 0.1s; }
#resultsSection > div:nth-child(2) { animation-delay: 0.2s; }
#resultsSection > div:nth-child(3) { animation-delay: 0.3s; }
#resultsSection > div:nth-child(4) { animation-delay: 0.4s; }
#resultsSection > div:nth-child(5) { animation-delay: 0.5s; }

/* Dark Mode Support (Optional for future enhancement) */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
        color: #e0e0e0;
    }
    
    .bg-white {
        background-color: #2d2d44;
        color: #e0e0e0;
    }
    */
}

/* Number Color Classes */
.text-number-1 { color: #ef4444; }
.text-number-2 { color: #f97316; }
.text-number-3 { color: #f59e0b; }
.text-number-4 { color: #84cc16; }
.text-number-5 { color: #10b981; }
.text-number-6 { color: #06b6d4; }
.text-number-7 { color: #3b82f6; }
.text-number-8 { color: #8b5cf6; }
.text-number-9 { color: #ec4899; }

.bg-number-1 { background-color: #fee2e2; }
.bg-number-2 { background-color: #ffedd5; }
.bg-number-3 { background-color: #fef3c7; }
.bg-number-4 { background-color: #ecfccb; }
.bg-number-5 { background-color: #d1fae5; }
.bg-number-6 { background-color: #cffafe; }
.bg-number-7 { background-color: #dbeafe; }
.bg-number-8 { background-color: #ede9fe; }
.bg-number-9 { background-color: #fce7f3; }

/* Prose Enhancement */
.prose h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.prose p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.prose ul {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

/* Mobile Navigation Improvements */
@media (max-width: 640px) {
    nav .flex {
        height: auto;
        padding: 1rem 0;
    }
    
    nav a {
        font-size: 0.875rem;
        padding: 0.5rem;
    }
}

/* Loading State */
.loading {
    pointer-events: none;
    opacity: 0.6;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(147, 51, 234, 0.1);
    border-top: 3px solid #9333ea;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

/* Success Message */
.success-message {
    background-color: #d1fae5;
    border-left: 4px solid #10b981;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Error Message */
.error-message {
    background-color: #fee2e2;
    border-left: 4px solid #ef4444;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

/* Info Box */
.info-box {
    background-color: #dbeafe;
    border-left: 4px solid #3b82f6;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

/* Warning Box */
.warning-box {
    background-color: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
}
