/* =========================================
   1. VARIABLES (THE THEME)
   ========================================= */
:root {
    /* Color Palette */
    --bg-main:   #1A1A1A;       /* Page Background */
    --bg-card:   #000000;       /* Container Background */
    --bg-input:  #222222;       /* Form/Input Background */

    --text-main: #E0E0E0;       /* Primary Text */
    --text-dim:  #888888;       /* Secondary Text */

    --accent:    #007bff;       /* Interactive Blue */
    --border:    #333333;       /* Borders */
}

/* =========================================
   2. RESET & BASE STYLES
   ========================================= */
/* The "Box Model" Fix: Ensures padding is included in width calculations */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    padding: 20px;

    /* Flexbox centering for the main page layout */
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* =========================================
   3. LAYOUT CONTAINERS
   ========================================= */
.container {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 1000px;
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* =========================================
   4. HEADER SECTION (Logo & Search)
   ========================================= */
.top-section {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.logo-container {
    flex-shrink: 0;
}

.logo {
    display: block;
    width: 250px;
    margin: 0;
}

/* Search Form Styling */
.search-box {
    flex: 1; /* Takes up remaining space */
    padding-left: 20px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 8px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input[type="text"] {
    width: 100%;
    background-color: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 12px;
    font-size: 16px;
    border-radius: 4px;
    font-family: inherit;
    transition: border-color 0.2s;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-primary {
    width: 100%;
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #0056b3;
}

/* =========================================
   5. RESULTS SECTION
   ========================================= */
/* Album Metadata Header */
.album-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
}

.album-art {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.album-info {
    flex: 1;
}

.album-title {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: var(--text-main);
}

.album-subtitle {
    margin: 0 0 15px 0;
    font-size: 20px;
    color: var(--text-main);
    opacity: 0.9;
}

.release-date {
    margin: 0;
    font-size: 14px;
    color: var(--text-dim);
}

.release-date span {
    color: var(--text-main);
}

/* Split View (Table vs JSON) */
.data-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.data-column {
    flex: 1;
    min-width: 0;
}

/* Column Headers */
.data-column h3 {
    margin: 0 0 20px 0; /* Adjusted to replace inline style */
    font-size: 16px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Table Styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    font-size: 14px;
}

th {
    text-align: left;
    padding: 12px 15px;
    background-color: var(--bg-input);
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
}

/* First Column (Track Number) */
td:first-child {
    color: var(--text-main);
    padding-right: 25px;
    text-align: right;
    width: 40px;
}

/* JSON Box & Copy Button */
textarea {
    width: 100%;
    height: 400px;
    background-color: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 15px;
    font-family: 'Courier New', monospace;
    border-radius: 4px;
    resize: none;
    display: block; /* Removes tiny gap at bottom */
}

.btn-copy {
    display: block;
    width: 100%;
    margin-top: 10px;
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 10px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-color 0.2s;
}

.btn-copy:hover {
    background-color: #0056b3;
}

/* =========================================
   6. WELCOME STATE
   ========================================= */
.welcome-section {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
}

.welcome-title {
    color: var(--text-main);
    margin-bottom: 20px;
}

.welcome-text {
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 auto 30px auto;
    line-height: 1.6;
}

.feature-grid {
    display: flex;
    gap: 20px;
    text-align: left;
    margin-top: 40px;
}

.feature-card {
    flex: 1;
    background: var(--bg-input);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.feature-card h3 {
    color: var(--accent);
    margin: 0 0 10px 0;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-dim);
    margin: 0;
}

/* =========================================
   7. COMPONENTS (Alerts, Badges, etc.)
   ========================================= */
.error-banner {
    background-color: #8B0000;  /* Dark Red */
    color: white;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #ff3333;  /* Subtle lighter border */
    font-weight: 500;
    text-align: center;         /* Centers the text inside the banner */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* =========================================
   8. RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
    .top-section,
    .data-container,
    .feature-grid {
        flex-direction: column;
    }

    .search-box {
        padding-left: 0;
        margin-top: 20px;
    }

    .album-header {
        flex-direction: column;
        text-align: center;
    }
}

/* =========================================
   9. API DOCUMENTATION
   ========================================= */
.api-section {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.api-section h3 {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    font-size: 16px;
}

.api-content {
    background-color: var(--bg-input);
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-dim);
}

.api-content code {
    color: var(--text-main);
    font-weight: bold;
}

.api-content pre {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 10px 0;
}