/* Custom CSS for Star Bond - Vedic Astrology Compatibility App */

/* Global font family setup */
body {
    font-family: 'Montserrat', sans-serif;
}

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

/* Welcome screen body override */
.welcome-screen-body {
    font-family: 'Montserrat', sans-serif !important;
}

/* App Header Styles */
.app-header {
    background: linear-gradient(180deg, #3B2A5C 0%, #6B46C1 100%);
    position: relative;
    z-index: 1000;
    padding: 1.5rem 0 4rem 0;
    overflow: hidden;
}

.app-header.wide {
    background: linear-gradient(180deg, #1C0E3B 0%, #473381 100%);
    padding: 1.5rem 0 4rem 0;
}

.app-header.wide::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    height: 100px;
    background: #F5F5F0;
    border-radius: 50px 50px 0 0;
}

.app-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(180deg, #3B2A5C 0%, #6B46C1 100%);
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
}

.app-header.compact {
    padding: 1rem 0 2.5rem 0;
}

.app-header.compact::after {
    height: 30px;
}

.header-content {
    max-width: 400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 10;
}

.app-header.wide .header-content {
    justify-content: center;
}

.app-header.compact .header-content {
    justify-content: center;
}

.header-menu-btn {
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    position: fixed;
    right: 1.5rem;
    top: 1.5rem;
    z-index: 1040;
    width: 44px;
    height: 44px;
}

.header-logo {
    display: block;
    text-decoration: none;
    position: relative;
    z-index: 10;
}

.header-logo img {
    height: 50px;
    width: auto;
}

.app-header.wide .header-logo img {
    height: 75px;
}

.app-header.compact .header-logo img {
    height: 35px;
}


.header-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.header-menu-btn:hover span {
    background: #D57062;
}

.header-menu-btn:active span {
    background: #C85A54;
}

/* Side Menu Styles */
.offcanvas {
    background: linear-gradient(180deg, #3B2A5C 0%, #6B46C1 100%);
    color: white;
    width: 280px !important;
}

.offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.offcanvas-title {
    color: white;
    font-family: 'Rubik', sans-serif;
}

.offcanvas-body .nav-link {
    color: white;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.offcanvas-body .nav-link:hover {
    color: #D57062;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Page layouts */
.page-content {
    background: #F5F5F0;
    min-height: calc(100vh - 120px);
    padding: 2rem 1rem;
    margin-top: -50px;
    padding-top: 70px;
}

/* App Footer Styles */
.app-footer {
    background: #55428D;
    color: white;
}

.footer-description {
    color: white;
    opacity: 0.9;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.4;
}

.footer-copyright {
    color: white;
    opacity: 0.8;
}

.footer-copyright-small {
    color: white;
    opacity: 0.8;
    font-size: 0.8rem;
}

.welcome-page {
    background: linear-gradient(180deg, #3B2A5C 0%, #6B46C1 50%, #8B5CF6 100%);
    min-height: 100vh;
    padding: 0;
}

/* Calculator Page Styles */
.calculator-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 1.5rem;
}

.guest-info-alert {
    background: #55428D;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: white;
    font-size: 0.9rem;
    line-height: 1.4;
    font-family: 'Montserrat', sans-serif;
}

.guest-info-alert i {
    color: #D57062;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.guest-info-alert a {
    color: white;
    text-decoration: underline;
}

.calculator-form {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section:last-of-type {
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: 'Rubik', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2D3748;
    margin-bottom: 1rem;
    border-bottom: 1px solid #E2E8F0;
    padding-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.form-row.time-row {
    grid-template-columns: 1.2fr 0.8fr;
}

.form-row.location-row {
    grid-template-columns: 1fr;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-family: 'Rubik', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4A5568;
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.425rem 0.75rem;
    border: 1px solid #CBD5E0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Montserrat', sans-serif;
    background: white;
    color: #2D3748;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #6B46C1;
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
    background: white;
    color: #2D3748;
}

.form-control::placeholder {
    color: #A0AEC0;
}

.calculate-btn {
    width: 100%;
    background: linear-gradient(90deg, #D57062 0%, #D57062 100%);
    border: none;
    border-radius: 50px;
    padding: 1rem 2rem;
    color: white;
    font-family: 'Rubik', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(213, 112, 98, 0.3);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(213, 112, 98, 0.4);
}

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

/* City suggestions */
.city-input-container {
    position: relative;
}

.city-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #CBD5E0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.city-suggestion {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #F7FAFC;
    transition: background-color 0.2s ease;
}

.city-suggestion:hover,
.city-suggestion.active {
    background-color: #F7FAFC;
}

.city-suggestion:last-child {
    border-bottom: none;
}

.city-suggestion-name {
    font-weight: 500;
    color: #2D3748;
    font-size: 0.9rem;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .calculator-container {
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-row.time-row {
        grid-template-columns: 1fr;
    }
    
    .form-row.location-row {
        grid-template-columns: 1fr;
    }
    
    .calculator-form {
        padding: 1.25rem;
    }
}

/* Very small screens */
@media (max-width: 375px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .guest-info-alert {
        font-size: 0.85rem;
        padding: 0.875rem;
    }
}

/* Loading overlay styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

/* Mobile-first responsive adjustments */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .display-5 {
        font-size: 1.75rem;
    }
    
    .display-1 {
        font-size: 3rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Enhanced form styling for better mobile experience */
.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Select2 dark theme customization */
.select2-container--bootstrap-5 .select2-selection {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

.select2-container--bootstrap-5 .select2-selection--single {
    height: calc(2.25rem + 2px);
}

.select2-container--bootstrap-5 .select2-dropdown {
    background-color: #FFFFFF;
    border-color: var(--bs-border-color);
}

.select2-container--bootstrap-5 .select2-results__option {
    color: #2D3748;
    background-color: #FFFFFF;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: var(--bs-primary);
    color: white;
}

.select2-container--bootstrap-5 .select2-results__options {
    background-color: #FFFFFF;
}

.select2-container--bootstrap-5.select2-container--open .select2-dropdown {
    background-color: #FFFFFF;
}

/* Enhanced progress bars */
.progress {
    background-color: var(--bs-secondary-bg);
}

/* Floating back to top button */
.btn-floating {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    
}

.btn-floating:hover {
    
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

/* Enhanced card hover effects */
.card {
    
}

.card:hover {
    
}

/* Better spacing for mobile */
@media (max-width: 576px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* Improved table styling for mobile */
@media (max-width: 768px) {
    .table-responsive table {
        font-size: 0.75rem;
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 0.5rem 0.25rem;
    }
    
    .badge {
        font-size: 0.65rem;
    }
}

/* Flash messages container - positioned inside page-content */
.flash-messages-container {
    max-width: 400px;
    margin: 0 auto 1rem auto;
    padding: 0 1rem;
}

/* Enhanced notification styles */
.alert {
    border-radius: 0.375rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Custom star rating visual */
.star-rating {
    color: var(--bs-warning);
}

/* Improved form validation feedback */
.invalid-feedback {
    display: block;
    font-size: 0.875rem;
    color: var(--bs-danger);
}

.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
    border-color: var(--bs-danger);
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath d='M5.8 3.6h.4L6 6.5z'/%3E%3Ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:valid,
.was-validated .form-select:valid {
    border-color: var(--bs-success);
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Enhanced focus states for better accessibility */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Improved spacing for results page */
.results-container {
    max-width: 100%;
    margin: 0 auto;
}

/* Enhanced compatibility level styling */
.compatibility-excellent {
    color: var(--bs-success);
    font-weight: 600;
}

.compatibility-very-good {
    color: var(--bs-info);
    font-weight: 600;
}

.compatibility-average {
    color: var(--bs-warning);
    font-weight: 600;
}

.compatibility-poor {
    color: var(--bs-danger);
    font-weight: 600;
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .card-header,
    footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .text-primary,
    .text-success,
    .text-info,
    .text-warning,
    .text-danger {
        color: #000 !important;
    }
    
    .bg-primary,
    .bg-success,
    .bg-info,
    .bg-warning,
    .bg-danger {
        background-color: #f8f9fa !important;
        color: #000 !important;
    }
}

/* Smooth animations disabled */

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
    .card {
        border-width: 2px;
    }
    
    .btn {
        border-width: 2px;
    }
    
    .form-control,
    .form-select {
        border-width: 2px;
    }
}

/* City suggestions dropdown */
.city-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.city-suggestion {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #E5E7EB;
    color: #2D3748;
    background: #FFFFFF;
}

.city-suggestion:hover,
.city-suggestion.active {
    background-color: #EBF8FF;
    color: #2D3748;
}

.city-suggestion:last-child {
    border-bottom: none;
}

.city-suggestion-name {
    font-weight: 500;
    color: #2D3748;
}

.city-suggestion-details {
    font-size: 0.875rem;
    color: #6B7280;
}

/* Position relative for city input containers */
.city-input-container {
    position: relative;
}

/* Disable ALL animations and transitions globally */
*,
::before,
::after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
}

/* Force disable Bootstrap animations */
.fade {
    opacity: 1 !important;
}

.fade:not(.show) {
    opacity: 0 !important;
}

.collapse {
    display: none !important;
}

.collapse.show {
    display: block !important;
}

.collapsing {
    height: auto !important;
    
}

/* Disable hover effects that might cause flicker */
.btn:hover,
.btn:focus,
.btn:active,
.btn.active {
    
    
}

.card:hover {
    
    
}

/* Modal stabilization - remove all animations */
.modal {
    --bs-modal-zindex: 1055;
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1055;
}

.modal.show {
    display: block !important;
}

.modal-backdrop {
    display: none !important;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    pointer-events: none;
    max-width: 800px;
}

.modal-content {
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    position: relative;
    pointer-events: auto;
    background-color: var(--bs-body-bg);
    border-radius: 0.375rem;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.modal-title {
    margin: 0;
    line-height: 1.5;
}

.modal-body {
    position: relative;
    padding: 1rem;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem;
    border-top: 1px solid var(--bs-border-color);
}

/* Ensure modal cards don't cause layout shifts */
.modal-body .card {
    margin-bottom: 1rem;
}

.modal-body .card:last-child {
    margin-bottom: 0;
}

/* Fix modal display issues */
.modal-open {
    overflow: hidden;
}

/* Close button styling */
.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
    padding: 0;
    width: 1em;
    height: 1em;
}

.btn-close:hover {
    opacity: 1;
}

.btn-close::before {
    content: "×";
}

/* Profile page specific styles */
.score-badge {
    white-space: nowrap;
}

.delete-btn {
    background: none;
    border: none;
    color: var(--bs-danger);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.delete-btn:hover {
    background-color: var(--bs-danger);
    color: white;
}
