/* Global styles - place this at the top of your styles.css */
body {
    background-color: #000;
    color: white;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    width: 100%;
}

.logo-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.4;
    z-index: -1;
}

.logo-background h1 {
    font-size: clamp(40px, 15vw, 100px);
    font-weight: bold;
}

.orange-box {
    background-color: #ff8c00;
    padding: 0 10px;
    color: black;
}

/* Content styles */
.content {
    z-index: 1;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    line-height: 1.6;
}

.search-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    z-index: 95;
    background-color: black;
    padding: 20px;
}

.search-container input {
    width: min(300px, 70vw);
    padding: 8px;
    border-radius: 16px;
    border: 2px solid #ff8c00;
    background-color: #000;
    color: white;
    font-size: 16px;
    outline: none;
}

.search-container input::placeholder {
    color: #ccc;
}

/* Top items (search bar and filters) */
.top-items {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

/* Styles for the Favorite filter (star circle) */
.favorite-filter {
    width: 40px;
    height: 40px;
    border: 2px solid #ff8c00;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 10px;
    cursor: pointer;
    background-color: transparent;
}

.favorite-filter::before {
    content: '\2605';
    font-size: 28px;
    color: #ff8c00;
    line-height: 1;
}

.favorite-checked {
    background-color: #ff8c00;
    border: 2px solid transparent;
}

.favorite-checked::before {
    content: '\2605';
    color: black;
}

/* Container for the favorite star */
.favorite-icon-container {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 27.5px;
    height: 30px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    cursor: pointer;
}

/* Style for the favorite star itself */
.favorite-icon {
    font-size: 28px;
    color: #ff8c00;
    position: relative;
    top: -3px;
}

.favorite-icon:hover {
    color: #ffa733;
}

.favorite-icon-container:hover .favorite-icon {
    color: #ffa733;
}

.favorite-icon.filled {
    content: '★';
}

.favorite-icon.empty {
    content: '☆';
}

.grid-item.favorite {
    border-color: #ff8c00;
}

/* Styles for the Outdated filter */
.outdated-filter {
    width: 40px;
    height: 40px;
    border: 2px solid #ff8c00;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 10px;
    cursor: pointer;
    background-color: transparent;
}

.outdated-filter::before {
    content: '🚫';
    font-size: 36px;
    opacity: 0.3;
    line-height: 1;
}

.outdated-filter.active::before {
    opacity: 1;
    color: #ff8c00;
}

.outdated-filter.greyed-out::before {
    opacity: 0.3;
}

/* Dropdown circle styles */
.dropdown-circle {
    width: 40px;
    height: 40px;
    border: 2px solid #ff8c00;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
    cursor: pointer;
    background-color: transparent;
    position: relative;
    z-index: 201;
}

.dropdown-circle::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid #ff8c00;
}

/* Dropdown menu styles */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 45px;
    left: 0;
    background-color: #333;
    border-radius: 5px;
    width: 150px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 202;
    overflow: hidden;
}

.dropdown-option {
    padding: 10px;
    color: white;
    background-color: #333;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 2000;
}

.dropdown-option.active {
    background-color: #ff8c00;
    color: black;
    z-index: 2000;
}

.dropdown-option:hover {
    background-color: #ff8c00;
    z-index: 2000;
}

/* Alphabet filter styles */
.alphabet-filter {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    gap: 5px;
}

.alphabet-filter span {
    font-size: 16px;
    color: gray;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
}

.alphabet-filter span::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 2px;
    background-color: transparent;
    transition: background-color 0.3s ease;
}

.alphabet-filter span:hover {
    color: #ff8c00;
}

.alphabet-filter span:hover::after {
    background-color: #ff8c00;
}

.active-letter {
    color: orange !important;
}

.active-letter::after {
    background-color: orange !important;
}

.orange-line {
    position: fixed;
    pointer-events: none;
    display: block;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, transparent, orange, transparent);
    margin: 0;
    top: 107px;
    left: 0;
    z-index: 100;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 170px));
    gap: 10px;
    justify-content: center;
    margin: 0 auto;
    margin-top: 155px;
    width: 90%;
    max-width: 1200px;
    position: relative;
    padding: 0 10px;
}

/* Grid item */
.grid-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
    border: 5px solid #ff8c00;
    width: 100%;
    aspect-ratio: 170/275;
    max-width: 170px;
}

/* Image inside the grid item */
.grid-item img {
    width: 105%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Black bar with the name */
.item-name {
    position: absolute;
    bottom: 0;
    width: 100%;
    background-color: black;
    color: white;
    text-align: center;
    padding: 10px 0;
    font-size: 16px;
}

.grid-item:hover img {
    transform: scale(1.05);
}

.grid-item:hover {
    transform: scale(1.05);
}

.add-button {
    position: fixed;
    bottom: 50px;
    right: 50px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background-color: #ff8c00;
    color: black;
    font-size: 42px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.add-button:hover {
    background-color: #ff9900;
    transform: scale(1.1);
}

/* Modal backdrop */
.add-modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

/* Modal content box */
.add-modal-content {
    background-color: #333;
    color: #ff8c00;
    border-radius: 10px;
    padding: 20px;
    width: min(400px, 90vw);
    max-width: 90vw;
    position: relative;
    text-align: center;
}

/* Close (X) button */
.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
    color: #ff8c00;
}

.add-modal input[type="text"], .add-modal input[type="url"], .add-modal input[type="file"] {
    width: 80%;
    padding: 10px;
    margin: 40px 0;
    border-radius: 5px;
    border: 2px solid #ff8c00;
    background-color: #444;
    color: #ff8c00;
    display: block;
    margin-left: auto;
    margin-right: auto;
    outline: none;
}

.add-modal input:focus {
    border-color: #ffffff;
    outline: none;
}

.add-modal button {
    background-color: #ff8c00;
    color: #000000;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    margin: 0 10px;
    transition: background-color 0.3s ease;
}

.add-modal button:hover {
    background-color: #ffa733;
}

.error-message {
    color: red;
    font-size: 14px;
    margin-top: -35px;
    margin-bottom: -21px;
    font-weight: normal;
    display: none;
}

.add-modal input:focus:not(.error) {
    border-color: #ffffff;
}

.add-modal input.error {
    border: 2px solid red;
}

.edit-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #ff8c00;
    color: #000000;
    border: none;
    border-radius: 3px;
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
    display: none;
}

.grid-item:hover .edit-btn {
    display: block;
}

.add-modal button.outdated-btn {
    background-color: #607d8b !important;
    color: white !important;
    margin-top: 20px;
    margin-right: 35px;
}

.add-modal button.update-btn {
    background-color: #4caf50 !important;
    color: white !important;
    margin-top: 20px;
    margin-right: 35px;
}

.add-modal button.outdated-btn:hover {
    background-color: #78909c !important;
}

.add-modal button.update-btn:hover {
    background-color: #66bb6a !important;
}

.grid-item.outdated img.item-image {
    filter: grayscale(100%);
    opacity: 0.9;
}

.grid-item.outdated .outdated-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: auto;
    z-index: 1;
    opacity: 1;
    border: red;
    pointer-events: none;
}

.bottom-left-buttons {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bottom-left-buttons button, .bottom-left-buttons .import-label {
    background-color: #ff8c00;
    color: black;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.bottom-left-buttons .import-label {
    cursor: pointer;
    display: inline-block;
}

.modal-active .search-container,
.modal-active .top-items,
.modal-active .alphabet-filter,
.modal-active .content-grid,
.modal-active .add-button,
.modal-active .bottom-left-buttons {
    pointer-events: none;
}

.modal-backdrop, .add-modal-content {
    pointer-events: auto;
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    .search-container {
        padding: 15px 10px;
    }
    
    .top-items {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .dropdown-circle,
    .favorite-filter,
    .outdated-filter {
        width: 35px;
        height: 35px;
    }
    
    .dropdown-circle::before {
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-top: 8px solid #ff8c00;
    }
    
    .favorite-filter::before,
    .outdated-filter::before {
        font-size: 24px;
    }
    
    .alphabet-filter {
        flex-wrap: wrap;
        gap: 3px;
        padding: 0 10px;
    }
    
    .alphabet-filter span {
        font-size: 14px;
    }
    
    .content-grid {
        margin-top: 180px;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
        width: 95%;
        padding: 0 5px;
    }
    
    .add-button {
        width: 55px;
        height: 55px;
        font-size: 36px;
        bottom: 30px;
        right: 30px;
    }
    
    .bottom-left-buttons {
        bottom: 15px;
        left: 15px;
    }
    
    .bottom-left-buttons button,
    .bottom-left-buttons .import-label {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .add-modal-content {
        padding: 15px;
    }
    
    .add-modal input[type="text"],
    .add-modal input[type="url"],
    .add-modal input[type="file"] {
        width: 85%;
        margin: 30px 0;
    }
    
    .add-modal button {
        padding: 8px 15px;
        font-size: 16px;
        margin: 5px;
    }
}

@media screen and (max-width: 480px) {
    .content-grid {
        margin-top: 200px;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .alphabet-filter span {
        font-size: 12px;
    }
    
    .search-container input {
        font-size: 14px;
    }
    
    .add-button {
        width: 50px;
        height: 50px;
        font-size: 32px;
        bottom: 20px;
        right: 20px;
    }
}