/*? Default Styling */
#search-box {
    width: 95%;
    max-width: 1200px;
    height: 50px;
    margin: 50px auto;
    border-radius: 20px;
    border: 2px solid rgb(79, 5, 102);
    background-color: rgba(255, 255, 255, 0.95);
    padding: 5px 20px;
    font-size: 30px;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

#search-box:focus {
    border-color: rgb(128, 8, 165);
    box-shadow: 0 0 15px rgba(79, 5, 102, 0.5);
    background-color: white;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-gap: 30px;
    width: 95%;
    margin: 20px auto;
    padding: 20px;
    box-sizing: border-box;
}

.item-container {
    width: 100%;
    text-align: center;
    font-size: 15px;
    transition: transform 0.3s ease;
}

.item-container:hover {
    transform: translateY(-5px);
}

.item-container img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.5s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #4a0873, #2d0552);
    display: block;
    min-height: 200px;
}

/* Vinyl disc placeholder */
.vinyl-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 200px;
    background: linear-gradient(135deg, #2d0552, #4a0873, #2d0552);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.vinyl-disc {
    width: 80%;
    aspect-ratio: 1 / 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at center, 
        #1a1a1a 0%, 
        #1a1a1a 15%, 
        #2a2a2a 15%, 
        #1a1a1a 16%, 
        #2a2a2a 17%, 
        #1a1a1a 18%, 
        #2a2a2a 19%, 
        #1a1a1a 20%, 
        #2a2a2a 21%, 
        #1a1a1a 22%,
        #2a2a2a 23%,
        #1a1a1a 24%,
        #2a2a2a 25%,
        #1a1a1a 26%,
        #2a2a2a 100%);
    border-radius: 50%;
    animation: spinVinyl 3s linear infinite;
    box-shadow: 
        0 0 0 3px #1a1a1a,
        0 4px 12px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.vinyl-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 25%;
    aspect-ratio: 1 / 1;
    background: radial-gradient(circle, #8b0eb5, #4a0873);
    border-radius: 50%;
    box-shadow: 
        0 0 10px rgba(139, 14, 181, 0.6),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
}

.vinyl-center::before {
    content: '♪';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: white;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

@keyframes spinVinyl {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Pause spin on hover for better visibility */
.item-container:hover .vinyl-disc {
    animation-play-state: paused;
}

.item-container:hover .vinyl-placeholder {
    cursor: pointer;
}

.item-container img:hover {
    cursor: pointer;
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(79, 5, 102, 0.6);
}

.item-container p {
    margin-top: 10px;
    line-height: 1.4;
}

.item-container strong {
    font-size: 16px;
    color: white;
}

.item-container small {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

/* Add to queue button */
.add-queue-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgb(79, 5, 102), rgb(128, 8, 165));
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(79, 5, 102, 0.4);
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.add-queue-btn:hover {
    background: linear-gradient(135deg, rgb(128, 8, 165), rgb(79, 5, 102));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 5, 102, 0.6);
}

.add-queue-btn:active {
    transform: translateY(0);
}

.clickable-song {
    cursor: pointer;
}

/* Notification system */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    max-width: calc(100vw - 40px);
    box-sizing: border-box;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.notification-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.notification-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(135deg, #2d0552, #4a0873);
    border: 3px solid rgb(128, 8, 165);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
    text-align: center;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    color: white;
    margin: 0 0 20px 0;
    font-size: 28px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.modal-song-info {
    color: white;
    margin: 0 0 25px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.modal-song-info strong {
    font-size: 18px;
    color: #ffffff;
}

.modal-song-info small {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.singer-input {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.95);
    color: #1a0033;
    margin-bottom: 25px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.singer-input:focus {
    outline: none;
    border-color: rgb(128, 8, 165);
    box-shadow: 0 0 15px rgba(128, 8, 165, 0.5);
    background: white;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.modal-btn-cancel {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
}

.modal-btn-cancel:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.modal-btn-confirm {
    background: linear-gradient(135deg, rgb(79, 5, 102), rgb(128, 8, 165));
    color: white;
}

.modal-btn-confirm:hover {
    background: linear-gradient(135deg, rgb(128, 8, 165), rgb(79, 5, 102));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 5, 102, 0.6);
}

.modal-btn:active {
    transform: translateY(0);
}

.loading, .error, .no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    font-size: 18px;
}

.loading {
    color: white;
}

.error {
    color: #ff6b6b;
}

.no-results {
    color: rgba(255, 255, 255, 0.7);
}

.container {
    background-color: rgba(0, 0, 0, 0.479) !important;
    width: 95%;
    max-width: 1400px;
    height: 75vh;
    padding: 1px;
    border: 5px solid rgb(79, 5, 102);
    border-radius: 10px;
    color: white;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0 auto;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 20px 0;
}

/*? Computer styling  */
body {
    background: linear-gradient(135deg, #1a0033 0%, #2d0552 25%, #4a0873 50%, #2d0552 75%, #1a0033 100%);
    background-size: 400% 400%;
    background-attachment: fixed;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

::-webkit-scrollbar {
    background-color: rgba(255, 255, 255, 0.342);
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    width: 15px;
}

::-webkit-scrollbar-thumb {
    background: rgb(79, 5, 102);
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgb(128, 8, 165);
}

/*? Phone styling */
@media (max-width: 768px) {
    body {
        padding: 10px 0;
    }

    #search-box {
        font-size: 18px;
        height: 48px;
        margin: 20px auto;
        padding: 5px 15px;
        border-radius: 15px;
    }

    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        grid-gap: 15px;
        padding: 15px;
    }

    .container {
        height: calc(100vh - 120px);
        width: 98%;
        border-width: 3px;
        padding: 0;
    }

    .item-container strong {
        font-size: 14px;
    }

    .item-container small {
        font-size: 12px;
    }

    .item-container img,
    .vinyl-placeholder {
        min-height: 140px;
    }

    .add-queue-btn {
        padding: 10px 18px;
        font-size: 13px;
        min-height: 44px;
    }

    .modal-content {
        padding: 25px;
        width: 95%;
    }

    .modal-content h2 {
        font-size: 22px;
    }

    .modal-song-info strong {
        font-size: 16px;
    }

    .modal-song-info small {
        font-size: 13px;
    }

    .modal-btn {
        padding: 12px 20px;
        font-size: 15px;
        min-width: 120px;
        min-height: 48px;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .modal-btn {
        width: 100%;
    }

    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        font-size: 14px;
        padding: 12px 15px;
    }

    .singer-input {
        font-size: 16px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    #search-box {
        font-size: 16px;
        height: 44px;
        margin: 15px auto;
    }

    .grid-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-gap: 8px;
        padding: 8px;
        width: 100%;
    }

    .container {
        width: 98%;
        padding: 0;
    }

    .item-container img,
    .vinyl-placeholder {
        min-height: 120px;
    }

    .vinyl-center::before {
        font-size: 16px;
    }

    .item-container strong {
        font-size: 13px;
    }

    .item-container small {
        font-size: 11px;
    }

    .add-queue-btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    .modal-content {
        padding: 20px;
    }

    .modal-content h2 {
        font-size: 20px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        height: calc(100vh - 100px);
    }

    #search-box {
        margin: 15px auto;
    }

    body {
        padding: 5px 0;
    }
}
