/* General Styling */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Changed from center to allow scrolling */
    position: relative;
    overflow-x: hidden; /* Only hide horizontal overflow */
    padding: 2rem 0; /* Add some padding to top and bottom */
}

/* Dark mode scrim */
[data-theme="dark"] .background-slideshow::after {
    background-color: rgba(0, 0, 0, 0.7); /* Dark scrim */
}

/* Light mode scrim */
[data-theme="light"] .background-slideshow::after {
    background-color: rgba(255, 255, 255, 0.7); /* Light scrim */
}

/* Background Slideshow Styling */
.background-slideshow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.background-slideshow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition: background-color 0.3s ease;
}

.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.background-image.active {
    opacity: 1;
}

/* Common Container Styles */
.container-base {
    background: var(--bg-overlay);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 12px;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* Login Container */
.login-container {
    composes: container-base;
    max-width: 400px;
    text-align: center;
    opacity: 0;
    animation: fadeInDown 0.8s ease-out forwards;
    animation-delay: 2s;
}

/* Affirmations Container */
.content-container {
    background: var(--bg-overlay);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    position: relative;
    z-index: 2;
    max-height: 90vh; /* Limit height */
    overflow-y: auto; /* Allow vertical scrolling */
}

/* Form Elements */
.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

input[type="password"], textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

input[type="password"]:focus, textarea:focus {
    outline: none;
    border-color: var(--text-secondary);
}

/* Buttons */
.button {
    background: var(--button-bg);
    color: var(--text-primary);
    border: 1px solid var(--input-border);
    padding: 0.75rem 2rem;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
}

.button:hover {
    background: var(--button-hover);
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
}

/* Messages */
.error-message {
    color: var(--error-text);
    font-size: 0.9rem;
    margin: 1rem 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.error-message.visible {
    opacity: 1;
}

/* Affirmations Specific Styles */
.affirmations-list {
    margin-top: 1.5rem;
}

.affirmation-card {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: transform 0.2s;
}

.affirmation-card:hover {
    transform: translateY(-2px);
}

.affirmation-text {
    color: var(--text-primary);
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.affirmation-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Styling */
@media (max-width: 850px) {
    .container-base {
        margin: 1rem;
        padding: 1.5rem;
    }
}

@media (max-width: 600px) {
    .login-container {
        padding: 1.5rem;
        max-width: 90%;
    }

    .login-container h1 {
        font-size: 1.5rem;
    }

    input[type="password"], textarea {
        padding: 0.5rem;
        font-size: 1rem;
    }

    .button {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
    
    .affirmation-card {
        padding: 1rem;
    }
}

/* Style the scrollbar */
.content-container::-webkit-scrollbar {
    width: 8px;
}

.content-container::-webkit-scrollbar-track {
    background: var(--bg-overlay);
    border-radius: 4px;
}

.content-container::-webkit-scrollbar-thumb {
    background: var(--button-bg);
    border-radius: 4px;
}

.content-container::-webkit-scrollbar-thumb:hover {
    background: var(--button-hover);
}

.affirmations-list {
    max-height: 0;
    opacity: 0;
    transition: max-height 0.5s ease-in-out, opacity 0.3s ease-in-out;
    overflow: hidden;
}

.affirmations-list.visible {
    max-height: 2000px; /* Adjust based on your needs */
    opacity: 1;
}

.affirmation-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.affirmation-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.save-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: var(--bg-overlay);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 12px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease-out;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.save-modal.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.location-status {
    margin: 1rem 0;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    opacity: 0.5;
}

.location-status.saving {
    background: var(--input-bg);
    opacity: 1;
}

.location-status.saved {
    background: var(--button-bg);
    opacity: 1;
}

.location-status i {
    margin-right: 0.5rem;
}