/* Custom CSS for I Ching Oracle App */

:root {
    --primary-color: #2c5aa0;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --yin-color: #4a5568;
    --yang-color: #2d3748;
    --gold-color: #d4af37;
}

/* Typography */
body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: 'Crimson Text', serif;
    font-weight: 600;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Crimson Text', serif;
}

/* Navbar Customization */
.navbar-brand {
    font-family: 'Crimson Text', serif;
    font-size: 1.5rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a4480 100%);
    position: relative;
    overflow: hidden;
}

/* Ensure hero content stays above background pattern */
.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="hexPattern" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><polygon points="10,2 18,7 18,13 10,18 2,13 2,7" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23hexPattern)"/></svg>') repeat;
    opacity: 0.3;
    z-index: -1; /* Place background pattern behind content */
    pointer-events: none; /* Ensure it doesn't interfere with clicks */
}

.min-vh-75 {
    min-height: 75vh;
}

/* Hexagram Styles */
.hexagram-container {
    display: inline-block;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.hexagram-lines {
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    align-items: center;
}

.hexagram-line {
    width: 80px;
    height: 6px;
    border-radius: 3px;
    position: relative;
}

.hexagram-line.yang {
    background-color: var(--yang-color);
}

.hexagram-line.yin {
    background: linear-gradient(to right, var(--yin-color) 35%, transparent 35%, transparent 65%, var(--yin-color) 65%);
}

/* Hexagram Display for Results */
.hexagram-display .hexagram-container {
    background: linear-gradient(145deg, #f0f4f8, #e2e8f0);
    border: 2px solid #e2e8f0;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.hexagram-line-display {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 6px 0;
    position: relative;
}

.line-symbol {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--dark-color);
    letter-spacing: 1px;
}

.hexagram-line-display.moving {
    animation: pulseGlow 2s infinite;
}

.moving-indicator {
    position: absolute;
    right: -25px;
    color: var(--warning-color);
    font-size: 1.5rem;
    animation: bounce 1s infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        background-color: transparent;
        box-shadow: 0 0 0 rgba(255, 193, 7, 0);
    }
    50% {
        background-color: rgba(255, 193, 7, 0.1);
        box-shadow: 0 0 20px rgba(255, 193, 7, 0.3);
        border-radius: 10px;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

/* Hexagram Preview Animation */
.hexagram-preview {
    animation: floatHexagram 6s ease-in-out infinite;
}

@keyframes floatHexagram {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Feature Cards */
.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.feature-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Step Numbers */
.step-number {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Loading Animation */
.hexagram-loading .hexagram-lines {
    gap: 6px;
}

.loading-line {
    width: 60px;
    height: 4px;
    animation: loadingPulse 1.5s ease-in-out infinite;
}

.loading-line:nth-child(1) { animation-delay: 0s; }
.loading-line:nth-child(2) { animation-delay: 0.2s; }
.loading-line:nth-child(3) { animation-delay: 0.4s; }
.loading-line:nth-child(4) { animation-delay: 0.6s; }
.loading-line:nth-child(5) { animation-delay: 0.8s; }
.loading-line:nth-child(6) { animation-delay: 1s; }

@keyframes loadingPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scaleX(0.8);
    }
    50% {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* About Page Symbols */
.yin-symbol, .yang-symbol {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--dark-color);
    letter-spacing: 2px;
    padding: 10px;
    background: linear-gradient(145deg, #f0f4f8, #e2e8f0);
    border-radius: 8px;
    display: inline-block;
}

.example-hexagram .hexagram-container {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    padding: 20px;
}

.example-hexagram .hexagram-line {
    width: 50px;
    height: 4px;
}

/* Interpretation Content */
.interpretation-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--dark-color);
}

.interpretation-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Card Enhancements */
.card {
    border-radius: 15px;
    overflow: hidden;
}

.card-header {
    border-bottom: none;
    font-weight: 600;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a4480 100%);
}

/* Buttons */
.btn {
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-lg {
    padding: 12px 30px;
    font-size: 1.1rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Form Enhancements */
.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.25);
}

/* Alert Customization */
.alert {
    border-Radius: 12px;
    border: none;
    font-weight: 500;
}

/* Modal Enhancements */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    border-radius: 15px 15px 0 0;
}

/* History Styles */
.history-item {
    border-left: 4px solid var(--primary-color);
    transition: background-color 0.3s ease;
}

.history-item:hover {
    background-color: rgba(44, 90, 160, 0.05);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hexagram-container {
        padding: 15px;
    }
    
    .hexagram-line {
        width: 60px;
        height: 5px;
    }
    
    .line-symbol {
        font-size: 1rem;
    }
    
    .feature-icon, .step-number {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .hero-section {
        padding: 40px 0;
    }
}

@media (max-width: 576px) {
    .hexagram-line {
        width: 50px;
        height: 4px;
        gap: 6px;
    }
    
    .btn-group .btn {
        margin-bottom: 10px;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}

/* Print Styles */
@media print {
    .navbar, .modal, .btn-group, footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #dee2e6;
        box-shadow: none;
    }
    
    .bg-primary, .bg-success, .bg-info, .bg-warning, .bg-secondary {
        background-color: #f8f9fa !important;
        color: #212529 !important;
    }
    
    .text-white {
        color: #212529 !important;
    }
}

/* Accessibility Enhancements */
.btn:focus, .form-control:focus, .form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1a4480;
}

/* Tooltips */
.tooltip-inner {
    background-color: var(--dark-color);
    font-size: 0.875rem;
}

.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: var(--dark-color);
}

.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: var(--dark-color);
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Enhanced Blockquote */
.blockquote {
    font-family: 'Crimson Text', serif;
    font-style: italic;
    font-size: 1.2rem;
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    margin: 20px 0;
}

.blockquote-footer {
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-size: 0.9rem;
    color: var(--secondary-color);
}
