:root {
    --app-bg: #1a1a1a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-primary: #fff;
    --text-secondary: rgba(255, 255, 255, 0.7);
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--app-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
}

/* Container max-width for larger screens - updated for 500px max width */
.container {
    width: 100%;
    max-width: 500px !important; /* Constrain to 500px on larger screens */
    margin-left: auto;
    margin-right: auto;
}

.navbar {
    padding: 2.5rem 0 1.5rem; /* Added 10px top and bottom padding to logo container */
    margin-bottom: 0;
}

.app-logo {
    height: 50.4px;
    width: auto;
    display: block;
    margin: 0 auto;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.app-logo:hover {
    opacity: 0.8;
}

/* Search input styling - ONLY for the search page */
.search-section .card {
    background: transparent;
    border: none;
    box-shadow: none;
    margin-top: -2rem; /* Move search box higher */
}

.search-section .card-body {
    padding: 0;
}

/* Fine-tune the Surprise button position on the search page */
.search-section .text-center {
    margin-top: 30px !important; /* Reduced from 40px to 30px to move button up 10px */
    margin-bottom: 25px !important; /* Keep spacing below surprise button */
}

/* Keep the search input where it is */
.search-section .input-group {
    margin-top: 30px; /* Keep this value the same */
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
}

.search-section .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 4px;
}

.search-section .form-control:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

/* Search results styling */
#searchResults {
    margin-top: 0.5rem;
    width: 100%;
}

.film-card {
    display: flex;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer !important;
    transition: background-color 0.2s ease;
}

.film-card:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.film-poster {
    width: 50px;
    min-width: 50px;
    height: 75px;
    margin-right: 0.75rem;
}

.film-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.film-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.film-title {
    font-size: 1rem;
    margin: 0;
    color: var(--text-primary);
}

.film-year {
    font-size: 0.85rem;
    margin: 0;
    color: var(--text-secondary);
}

.no-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.search-result {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer !important;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: background-color 0.2s ease;
}

.search-result:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.search-result-thumb {
    width: 45px;
    height: 68px;
    border-radius: 4px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
}

.search-result-info {
    flex: 1;
}

@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }

    .display-4 {
        font-size: 2rem;
    }

    .haiku-container {
        padding: 1.5rem;
    }

    .haiku-content p {
        margin-bottom: 2rem;
    }
}

.movie-poster {
    width: 90px;
    height: 135px;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
}

.movie-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.movie-header p {
    font-size: 0.875rem;
}

.movie-details {
    background: transparent;
    padding: 1rem 0 0; /* Removed bottom padding */
    margin-bottom: 0;
}

.movie-details h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.movie-details p {
    font-size: 0.875rem;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer !important;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    overflow: hidden;
}

.btn:active,
.share-button:active {
    transform: translateY(1px);
}

.btn-link {
    color: var(--text-secondary);
}

.btn-link:hover {
    color: var(--text-primary);
}

/* Update button styles to ensure hover and click states work */
.btn-outline-secondary {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: var(--text-primary);
    transition: all 0.2s ease;
    cursor: pointer !important;
    position: relative;
    z-index: 1;
}

.btn-outline-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn-outline-secondary:active {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(1px);
}

.btn-outline-secondary:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* Ensure all interactive elements show pointer cursor */
.btn, 
.search-result,
.share-button,
#shareToggle,
.app-logo {
    cursor: pointer !important;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto !important;
}

/* Control the size of Feather icons in buttons to match other button content */
#backToSearch svg {
    width: 14px;  /* Reduced from 16px to match the sparkle icon */
    height: 14px; /* Reduced from 16px to match the sparkle icon */
    vertical-align: -3px; /* Fine-tune vertical alignment */
}

/* Add hover effect overlay */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.btn:hover::before {
    opacity: 1;
}

.share-container {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.share-options {
    text-align: right;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
    position: absolute;
    right: 0;
    top: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    min-width: 150px;
    z-index: 1000;
}

.share-options.show {
    opacity: 1;
    visibility: visible;
}

.share-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    transition: all 0.2s ease;
    margin: 0.25rem;
    cursor: pointer !important;
    color: var(--text-primary);
    background: transparent;
    border: none;
    width: 100%;
    justify-content: flex-start;
    border-radius: 4px;
}

.share-button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

#copySuccess {
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    margin-top: 0.5rem;
    text-align: center;
}

#copySuccess.visible {
    opacity: 1;
}

.btn-group > .btn {
    padding: 0.375rem 0.625rem;
}


.haiku-container {
    background: transparent;
    padding: 0;
    margin-bottom: 0.5rem; /* Reduced from 0.75rem */
    text-align: center;
}

.haiku-content {
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    margin: 0; /* Reduced from 0.75rem 0 */
    color: var(--text-primary);
}

.haiku {
    margin-bottom: 0.25rem; /* Reduced by 10px for haiku #1 and haiku #2 */
    padding: 0.5rem;
    font-size: 1rem;
    opacity: 0; /* Start invisible */
}

.haiku.fade-in {
    animation: fadeIn 1s forwards;
}

.haiku:last-child {
    margin-bottom: 0.5rem;
}

/* Container setup for sticky footer */
.container.d-flex.flex-column.min-vh-100 {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main.flex-grow-1 {
    flex: 1 0 auto;
}

/* Footer fixed to bottom of viewport with minimal padding */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--app-bg);
    width: 100%;
    z-index: 10;
}

.footer-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding-bottom: 10px; /* Exactly 10px padding below text */
    opacity: 0; /* Start invisible */
    transition: opacity 1s ease;
}

.footer-wrapper.fade-in {
    opacity: 1;
}

.footer-wrapper .text-muted {
    font-size: 0.75rem;
}

/* Add these styles at the end of the file */

.ratings-container {
    margin-top: 0.75rem;
}

.rating-box {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.rating-icon {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.rating-value {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.capture-content {
    position: fixed;
    left: -9999px;
    background: var(--app-bg);
    padding: 2rem;
    border-radius: 8px;
    width: 600px;
    max-width: 100%;
}

.capture-content .movie-details,
.capture-content .haiku-container {
    background: transparent;
}

.capture-content .footer-wrapper {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Temporarily hide share functionality */
.share-container,
.share-options,
.share-button,
#shareToggle,
#shareOptions,
#copySuccess {
    display: none !important;
}

/* Animation for fade-in effect of haikus */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Hide loading text and spinner */
#filmResults .loading-text,
#loadingSpinner {
    display: none !important;
}

/* Error message style */
.error-message {
    padding: 1rem;
    color: #ff6b6b;
    text-align: center;
    background: rgba(255, 0, 0, 0.05);
    border-radius: 4px;
    margin-top: 1rem;
}

/* Fix for missing no-poster image */
.film-poster img[src="/static/images/no-poster.svg"],
.movie-poster[src="/static/images/no-poster.svg"] {
    background: rgba(255, 255, 255, 0.1);
    object-fit: contain;
}

/* Responsive adjustments for mobile */
@media (max-width: 576px) {
    .container {
        width: 100% !important; /* Full width on mobile */
        padding: 0 1rem;
    }
    
    .movie-poster {
        width: 70px;
        height: 105px;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
}
