html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Move scroll to body */
    overflow-x: hidden;
}

.container {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    overflow: visible; /* Remove container scroll */
}

main {
    width: 100%;
    position: relative; /* Changed from height: 100% */
}

.home-container {
    width: 100%;
    overflow: visible;  /* Ensure consistency */
}

#interpretationContainer {
    width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Remove all scrollbars except body */
.card, 
.card-body, 
main, 
.home-container,
#successResultsPanel,
.container {
    overflow: visible;
}

/* Ensure proper content wrapping */
textarea, 
.form-control {
    max-width: 100%;
    box-sizing: border-box;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.animated-question {
    background-color: #f8f9fa;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.5s ease-in-out forwards;
}

.animated-question:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.fade-in {
    opacity: 0;
    animation: fadeIn 2s forwards;
}

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

/* Ensure content stays within bounds */
* {
    max-width: 100%;
    box-sizing: border-box;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.fi {
    width: 1.2em;
    height: 1.2em;
    margin-right: 0.5rem;
}

.language-selector {
    position: relative;
}

.lang-button {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
    font-weight: 500;
    transition: all 0.2s ease;
}

.lang-button:hover {
    background: #f8f9fa;
}

.lang-button .fi {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
}

.lang-text {
    font-size: 0.95rem;
    margin: 0 4px;
}

.modern-dropdown {
    min-width: 200px;
    padding: 8px;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-top: 8px;
    background: white;
}

.modern-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modern-dropdown-item:hover {
    background: #f8f9fa;
    color: #333;
}

.modern-dropdown-item.active {
    background: #f0f0f0;
    font-weight: 500;
}

.modern-dropdown-item .fi {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
}

/* Add smooth transition for dropdown */
.dropdown-menu {
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* RTL Support */
[dir="rtl"] .modern-dropdown-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .lang-button {
    flex-direction: row-reverse;
}

[dir="rtl"] .dropdown-menu {
    text-align: right;
}

[dir="rtl"] .ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

[dir="rtl"] .me-2 {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

/* Footer Styles */
.dream-footer {
    margin-top: 4rem;
    padding: 2rem 0;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.02));
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.footer-stars {
    display: flex;
    gap: 1.5rem;
    color: indianred;
    font-size: 1.2rem;
}

.footer-stars i {
    opacity: 0.8;
    transition: all 0.3s ease;
}

.footer-stars i:hover {
    opacity: 1;
    transform: scale(1.2) rotate(5deg);
    color: #d46c6c;
}

.footer-text {
    font-family: 'Dancing Script', cursive;
    color: #666;
}

.footer-text p {
    margin: 0;
    font-size: 1.2rem;
}

.footer-quote {
    font-size: 1rem !important;
    opacity: 0.8;
    margin-top: 0.5rem !important;
}

/* Add subtle animation to stars */
@keyframes twinkle {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

.footer-stars i:nth-child(1) { animation: twinkle 3s infinite; }
.footer-stars i:nth-child(2) { animation: twinkle 3s infinite 1s; }
.footer-stars i:nth-child(3) { animation: twinkle 3s infinite 2s; }

/* Mystical Animations */
@keyframes floatingStar {
    0% { transform: translateY(0) rotate(0deg); opacity: 0.3; }
    50% { transform: translateY(-20px) rotate(180deg); opacity: 0.6; }
    100% { transform: translateY(0) rotate(360deg); opacity: 0.3; }
}

@keyframes glowPulse {
    0% { text-shadow: 0 0 10px rgba(255, 255, 255, 0.1); }
    50% { text-shadow: 0 0 20px rgba(255, 255, 255, 0.3); }
    100% { text-shadow: 0 0 10px rgba(255, 255, 255, 0.1); }
}

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

/* Add these keyframes to the existing animations */
@keyframes shine {
    to {
        background-position: 200% center;
    }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

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