body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Apply consistent text styles */
.movie-title,
.modal h2,
.form-group label,
.form-group input,
.form-group textarea,
.submit-btn,
.recommend-btn {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-weight: 400;
}

/* Match homepage font sizes */
.modal h2 {
    font-size: 1.25rem;  /* Match message-text size */
}

.form-group label,
.form-group input,
.form-group textarea,
.submit-btn,
.recommend-btn {
    font-size: 1rem;  /* Match option-button size */
}

.movies-container {
    width: 100%;
    margin: 0 auto;
    position: relative;
    bottom: 35rem
}

.movies-header {
    position: fixed;
    top: 1.5rem;
    width: 42rem;
    max-width: calc(100% - 2rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background-color: #18181B;
}

.movies-header::before {
    content: '';
    position: absolute;
    top: -20px;  /* Position above the header */
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to top, #18181B 0%, rgba(24, 24, 27, 0) 100%);  /* Reverse gradient direction */
    pointer-events: none;
}

.movies-header::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, #18181B 0%, rgba(24, 24, 27, 0) 100%);
    pointer-events: none;
}

.search-container {
    margin-bottom: 1rem;
    margin-top: 1rem;
}

#movieSearch {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #1E1E1E;
    border: 1px solid #3F3F46;
    border-radius: 0.5rem;
    color: white;
    font-size: 0.9rem;
}

#movieSearch:focus {
    outline: none;
    border-color: #2563EB;
}

.filters-container {
    display: flex;
    gap: 0.5rem; /* Minimal gap between filters */
    justify-content: space-between; /* Distribute filters evenly */
}

.filter-dropdown {
    flex: 1; /* Equal width for all filters */
    max-width: 100%; /* Prevent overflow */
    padding: 0.5rem 0; /* Adjust padding for height */
    background-color: transparent;
    border: none; /* Remove the border */
    border-radius: 0;
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    appearance: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right center;
    background-size: 10px;
    padding-right: 1.5rem; /* Space for the dropdown arrow */
    box-sizing: border-box;
}

.filter-dropdown:focus,
.filter-dropdown:active {
    outline: none !important; /* Remove outline on focus */
    background-color: transparent !important;
}

.filter-dropdown option {
    background-color: #1E1E1E;
    color: #fff;
    text-transform: capitalize;
    padding: 0.3rem;
}

.filter-dropdown::-ms-expand {
    display: none;
}

.filter-dropdown:hover {
    color: #fff;
    border-color: #2563EB;
}

.movie-grid {
    position: absolute; /* Change this */
    top: 20rem; /* Fixed distance from top */
    width: 42rem;
    max-width: calc(100% - 2rem);
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.movie-card {
    position: relative;
    border-radius: 4px;
    overflow: hidden; /* Ensures no inner content spills */
    cursor: pointer;
    padding: 0; /* Remove padding that might create artifacts */
    border: 2px solid transparent; /* Default transparent border */
    transition: border-color 0.2s ease; /* Smooth transition for hover effect */
    box-sizing: border-box; /* Include border and padding in size calculations */
    background-color: transparent; /* Ensure no background conflicts */
}

.movie-card:hover {
    border-color: #2563EB; /* Blue highlight on hover */
}


.movie-card:hover .movie-info {
    opacity: 1; /* Show on hover */
}

.movie-card:hover .movie-rating {
    color: white; /* Change star color to white on hover */
}

.movie-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
    border: none !important; /* Ensure no border on the poster image */
    margin: 0; /* Remove any default margin */
    padding: 0; /* Remove any padding */
    box-shadow: none !important; /* Remove any potential box-shadow */
}


.movie-info {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.2s ease; /* Smooth fade-in effect */
}

.movie-title {
    color: white;
    font-size: 0.9rem;
    text-align: center;
    padding: 0 0.5rem;
    margin-bottom: 0.25rem;
}

.movie-year {
    color: #999;
    font-size: 0.8rem;
}

.movie-rating {
    text-align: center;
    color: #666;
    font-size: 0.8rem;
    transition: color 0.2s ease;
}


.star.filled {
    color: #00E054;
}

.movie-card:hover .movie-poster {
    border: 2px solid #2563EB;
    transition: all 0.3s ease;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    z-index: 1000;
}

.modal h2 {
    margin-bottom: 2rem;
}

.search-wrapper {
    position: relative;
    width: 100%;
}

.clear-search {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    font-size: 1.2rem;
    cursor: pointer;
    display: none;  /* Hidden by default */
}

.clear-search:hover {
    color: white;
}

.modal-content {
    position: relative;
    background-color: #1E1E1E;
    margin: 5% auto;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 8px;
    color: white;
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    color: #666;
    font-size: 28px;
    cursor: pointer;
}

.close:hover {
    color: white;
}

.modal-info-item {
    margin: 10px 0;
    line-height: 1.6;
}

.modal-label {
    color: #666;
    margin-right: 8px;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #666;
}

.recommend-btn {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: #2563EB;
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.recommend-btn:hover {
    background-color: #1d4ed8;
}

.submit-btn {
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #2563EB;
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: #1d4ed8;
}

.recommend-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: #666;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    background-color: #2a2a2a;
    border: 1px solid #3F3F46;
    border-radius: 0.5rem;
    color: white;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #666;
    font-size: 0.8rem;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem;
    border-radius: 0.5rem;
    color: white;
    z-index: 2000;
    animation: slideIn 0.3s ease-out;
}

.notification.success {
    background-color: #10B981;
}

.notification.error {
    background-color: #EF4444;
}

.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
    z-index: 101; /* Make sure it's above the header */
}

.back-button:hover {
    color: white;
}

.back-arrow {
    font-size: 1.2rem;
    line-height: 1;
}

/* Update your skeleton styles */
.skeleton-grid {
    position: absolute;
    top: 20rem;
    width: 42rem;
    max-width: calc(100% - 2rem);
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr)); /* Force 4 columns */
    gap: 1rem;
}

.skeleton-wrapper {
    width: 100%;
}

.skeleton-card {
    width: 100%;
    aspect-ratio: 2/3;
    background-color: #27272A;
    border-radius: 4px;
    animation: pulse 1.5s ease-in-out infinite;
    margin-bottom: 0.5rem;
}

.skeleton-rating {
    height: 12px;
    width: 60%;
    margin: 0 auto;
    background-color: #27272A;
    border-radius: 2px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

/* Hide grid while loading */
.movie-grid.loading {
    visibility: hidden;
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.notification.fade-out {
    animation: slideOutFade 0.5s ease-in forwards;
}

/* Hover effects for desktop */
@media (min-width: 769px) {
    .movie-card:hover .movie-info {
        opacity: 1;
    }

    
    .movie-card:hover .movie-rating {
        color: white;  /* Change star color to white on hover */
    }
}

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

@media (max-width: 768px) {

    .movies-header {
        width: calc(100%);
        top: 2.5rem;
    }

    .skeleton-grid {
        width: calc(100%);
        max-width: calc(100%);
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }

    .movies-container {
        bottom: 30rem;
    }

    .back-button {
        top: 20px;
    }
  
    .movie-grid {
        width: calc(100%);
        max-width: calc(100%);
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
  
    .movie-poster {
      width: 100%;
      aspect-ratio: 2/3;
      max-width: 120px;
    }
  
    .movie-year {
      font-size: 0.7rem;
    }
  
    .modal-content {
      width: 90%;
      margin: 10% auto;
      padding: 15px;
    }

    .movie-info {
        display: none;
    }
  }
  
  @media (max-width: 480px) {
    .filters-container {
      flex-wrap: wrap;
      gap: 0.5rem;
    }
  
    .filter-dropdown {
      font-size: 0.9rem;
      padding: 0.4rem 0.8rem;
    }
  }
  