/* styles.css
Author: Konrad Szulc
Date Submitted: Dec 3rd 2025
Basic styles for layout, cards, grid and spinner.
*/

/* Global Styles */

:root {
    --bg: #FFA07A;
    --card: #f6f9fc;
    --accent: #2b7a78;
    --muted: #6b7280;
    --gap: 22px;
    --radius: 10px;
    --shadow: rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;
}

/* Box Sizing */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: var(--bg);
    color: var(--accent);
    padding: var(--gap);
    line-height: 1.5;
}

/* Main Body Layout */
.mainBody {
    max-width: 1200px;
    margin: 0 auto;
}

/* Card Component */
.card {
    background-color: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: var(--gap);
}

/* Header Element Styles */
.mainHeader h1 {
    margin: 0;
    font-size: 2rem;
    text-align: center;
}

.mainHeader p {
    text-align: center;
    color: var(--muted);
    margin-top: 4px;
}

/*Search Section */
#searchSection {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.search-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

/* Search Input Styles */
#artistSearch {
    flex: 1 1 250px;
    padding: 8px 16px;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: var(--radius);
    width: 250px;
}

/* Search Button Styles */
#searchBtn {
    padding: 8px 16px;
    font-size: 1rem;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

/* Disabled button styles when laading */
#searchBtn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* Error and Status Message Styles */
.status {
    color: #008000;
    margin: 4px 0 0 0;
}

.error {
    color: #ff0000;
    margin-top: 4px 0 0 0;
}

.results {
    max-height: 400px;
    overflow: auto;
}

/* Artist Search Results Styles */
.results .artist-search-result {
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    margin-bottom: 6px;
}

/* Hover and Focus Effects for Artist Results */
.results .artist-search-result:hover,
.results .artist-search-result:focus {
    background: #eef6f6;
    outline: none;
    border-color: #cbe6e5;
}

/* Artist Info Layout */
.artist-info {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.artist-info img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 6px;
}

/* Grid Layout for Albums */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    max-height: 400px;
    overflow: auto;
}

.album-card {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #e6eef0;
    background: linear-gradient(180deg, #ffffff, #fbfdfe);
    cursor: pointer;
    text-align: center;
}

.album-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
}

.album-card h3 {
    margin: 8px 0 4px 0;
    font-size: 1rem;
}

.album-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Album Details Styles */
.album-details {
    max-height: 360px;
    overflow: auto;
}

.album-details h4 {
    margin-top: 0;
}

/* Track List Styles */
.track {
    padding: 6px 8px;
    border-bottom: 1px solid #e6eef0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.track:last-child {
    border-bottom: none;
}

/* Muted Text Style */
.muted {
    color: var(--muted);
    font-size: 0.9rem;
}

/* Spinner */
.spinner {
    display: flex;
    align-items: center;
    margin: 8px 0;
    border: 6px solid white;
    border-left-color: red;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spinner 0.5s ease-in-out infinite;
}

/* Hidden class to hide elements */
.hidden {
    display: none
}

[hidden] {
    display: none !important
}

/* Spinner animation */
@keyframes spinner {
    0% {
        transform: rotate(0)
    }

    100% {
        transform: rotate(360deg)
    }
}

/* Accessibility helpers for screen readers */
.visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap
}

.sr-only {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden
}