/* RadioDJ RequestMagic General Styles */
:root {
    --rdrm-primary-color: #3498db;
    --rdrm-success-color: #2ecc71;
    --rdrm-error-color: #e74c3c;
    --rdrm-disabled-color: #bdc3c7;
    --rdrm-light-gray: #f0f0f0;
    --rdrm-dark-gray: #555;
    --rdrm-border-radius: 4px;
    --rdrm-box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Loader animation */
.rdrm-loader {
    border: 5px solid var(--rdrm-light-gray);
    border-top: 5px solid var(--rdrm-primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: rdrm-spin 1s linear infinite;
    margin: 20px auto;
}
.rdrm-loader-small {
    border: 3px solid var(--rdrm-light-gray);
    border-top: 3px solid var(--rdrm-primary-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: rdrm-spin 1s linear infinite;
    margin: 5px auto;
}

@keyframes rdrm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Search and Table */
#rdrm-search-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: var(--rdrm-border-radius);
    box-sizing: border-box;
}
#rdrm-search-input::placeholder {
    color: #aaa;
}

.rdrm-song-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.rdrm-song-table th, 
.rdrm-song-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--rdrm-light-gray);
    vertical-align: middle;
}

.rdrm-song-table th {
    background-color: #f8f8f8;
    font-weight: bold;
}

.rdrm-song-table tr:hover {
    background-color: #f5f5f5;
}

.rdrm-request-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 2.5em;
    text-align: center;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    transition: all 0.2s ease-in-out;
}

.rdrm-request-btn.requestable {
    color: var(--rdrm-success-color);
}
.rdrm-request-btn.requestable:hover {
    background-color: rgba(46, 204, 113, 0.1);
    transform: scale(1.1);
}

.rdrm-request-btn.not-requestable {
    color: var(--rdrm-error-color);
    cursor: help;
    font-size: 2em;
}
.rdrm-request-btn.not-requestable:hover {
    background-color: rgba(231, 76, 60, 0.1);
}

/* Pagination */
.rdrm-pagination {
    text-align: center;
    margin-top: 20px;
}

.rdrm-pagination .rdrm-pagination-link {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    border: 1px solid #ddd;
    border-radius: var(--rdrm-border-radius);
    text-decoration: none;
    color: var(--rdrm-primary-color);
    cursor: pointer;
}

.rdrm-pagination .rdrm-pagination-link:hover {
    background-color: var(--rdrm-primary-color);
    color: #fff;
}

.rdrm-pagination .current {
    background-color: var(--rdrm-primary-color);
    color: #fff;
    border-color: var(--rdrm-primary-color);
    cursor: default;
    padding: 8px 12px;
    margin: 0 4px;
    border: 1px solid var(--rdrm-primary-color);
    border-radius: var(--rdrm-border-radius);
    display: inline-block;
}

/* Modal */
.rdrm-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: rgba(0,0,0,0.6);
    -webkit-overflow-scrolling: touch;
}

.rdrm-modal-overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.rdrm-modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 25px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: var(--rdrm-border-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    animation: rdrm-modal-anim-desktop 0.4s;
    z-index: 2;
}
@keyframes rdrm-modal-anim-desktop {
    from { top: -200px; opacity: 0; }
    to { top: 0; opacity: 1; }
}

.rdrm-close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    z-index: 3;
}
.rdrm-close-modal:hover,
.rdrm-close-modal:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.rdrm-modal-header h3 { margin-top: 0; }
.rdrm-modal-song-title { font-weight: bold; color: var(--rdrm-dark-gray); margin-bottom: 20px; display: block; }
/* Modal Form */
.rdrm-form-field { margin-bottom: 15px; }
.rdrm-form-field label { display: block; margin-bottom: 5px; font-weight: bold; }
#rdrm-request-form input[type="text"], 
#rdrm-request-form input[type="email"], 
#rdrm-request-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: var(--rdrm-border-radius);
    box-sizing: border-box;
}
#rdrm-request-form textarea { resize: vertical; min-height: 80px; }
#rdrm-request-form .rdrm-form-field.required label::after { content: ' *'; color: var(--rdrm-error-color); }
#rdrm-submit-request { background-color: var(--rdrm-primary-color); color: white; padding: 12px 20px; border: none; border-radius: var(--rdrm-border-radius); cursor: pointer; width: 100%; font-size: 1em; }
#rdrm-submit-request:hover { opacity: 0.9; }
#rdrm-submit-request:disabled { background-color: var(--rdrm-disabled-color); cursor: not-allowed; }

/* Feedback Messages */
#rdrm-form-feedback { padding: 10px; margin-top: 15px; border-radius: var(--rdrm-border-radius); text-align: center; }
.rdrm-error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; padding: 10px; border-radius: var(--rdrm-border-radius); }
.rdrm-success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; padding: 10px; border-radius: var(--rdrm-border-radius); }

/* Now Playing & Recently Played & Top Charts Styles */
.rdrm-now-playing-container, 
.rdrm-recently-played-container,
.rdrm-top-charts-container,
.rdrm-shoutouts-container {
    padding: 15px;
    border: 1px solid var(--rdrm-light-gray);
    border-radius: var(--rdrm-border-radius);
    margin-bottom: 20px;
    background: #fff;
    box-shadow: var(--rdrm-box-shadow);
}
.rdrm-now-playing-container h4, 
.rdrm-recently-played-container h4,
.rdrm-top-charts-container h4,
.rdrm-shoutouts-container h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
    color: var(--rdrm-dark-gray);
    border-bottom: 2px solid var(--rdrm-light-gray);
    padding-bottom: 10px;
}

/* List styling with Cover Art support */
.rdrm-list-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dotted var(--rdrm-light-gray);
}
.rdrm-list-item:last-child {
    border-bottom: none;
}

.rdrm-cover-art {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 15px;
    background-color: #eee;
    flex-shrink: 0;
}
.rdrm-track-info {
    display: flex;
    flex-direction: column;
}
.rdrm-item-artist {
    font-weight: bold;
    color: var(--rdrm-dark-gray);
}
.rdrm-item-title {
    font-style: italic;
    color: #666;
    font-size: 0.95em;
}
.rdrm-item-rank {
    font-weight: bold;
    font-size: 1.2em;
    color: var(--rdrm-primary-color);
    margin-right: 15px;
    width: 25px;
    text-align: center;
}

/* Shoutouts (Dedication Wall) Styles */
.rdrm-shoutout-item {
    margin-bottom: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid var(--rdrm-primary-color);
    position: relative;
}
.rdrm-shoutout-item:last-child {
    margin-bottom: 0;
}
.rdrm-shoutout-header {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}
.rdrm-shoutout-song {
    font-weight: bold;
    font-size: 0.9em;
    color: var(--rdrm-dark-gray);
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}
.rdrm-shoutout-message {
    font-style: italic;
    color: #333;
    line-height: 1.4;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .rdrm-modal-content {
        width: 100%; height: 100%; min-height: 100vh;
        max-width: 100%; margin: 0; border-radius: 0; border: none;
        padding: 40px 15px 15px 15px;
        animation: rdrm-modal-anim-mobile 0.4s;
    }
    @keyframes rdrm-modal-anim-mobile { from { transform: translateY(100%); } to { transform: translateY(0); } }
    .rdrm-close-modal {
        position: fixed;
    }

    .rdrm-song-table thead { display: none; }
    .rdrm-song-table, 
    .rdrm-song-table tbody, 
    .rdrm-song-table tr { display: block; width: 100%; box-sizing: border-box; }
    .rdrm-song-table tr { padding: 10px; margin-bottom: 10px; border: 1px solid #ddd; border-radius: var(--rdrm-border-radius); }
    .rdrm-song-table td {
        display: flex; justify-content: space-between; align-items: center;
        text-align: right; padding: 8px 0; border-bottom: 0;
    }
    .rdrm-song-table td:not(:last-child) { border-bottom: 1px dotted #ccc; }
    
    .rdrm-song-table td[data-label="Artist"]::before,
    .rdrm-song-table td[data-label="Title"]::before {
        display: none;
    }
    
    .rdrm-song-table td[data-label="Request"]::before {
         content: attr(data-label);
         font-weight: bold;
         text-align: left;
         margin-right: 15px;
    }
    .rdrm-song-table td[data-label="Artist"] { font-weight: bold; justify-content: flex-start; }
    .rdrm-song-table td[data-label="Title"] { justify-content: flex-start; padding-left: 10px; }
}


/* Admin settings style */
.form-table .wp-picker-container { display: inline-block; vertical-align: middle; }
.form-table tr th, 
.form-table tr td { padding: 15px 10px; }
.rdrm-color-picker-wrapper { display: inline-flex; align-items: center; }

/* Admin Dashboard Table */
.rdrm-admin-table { width: 100%; border-collapse: collapse; margin-top: 10px; background: #fff; border: 1px solid #ccd0d4; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.rdrm-admin-table th, .rdrm-admin-table td { padding: 8px 10px; border-bottom: 1px solid #ccd0d4; text-align: left; }
.rdrm-admin-table th { font-weight: 600; }
.rdrm-status-pending { color: #e67e22; font-weight: bold; }
.rdrm-status-approved { color: #27ae60; font-weight: bold; }
.rdrm-action-btn { text-decoration: none; padding: 4px 8px; border-radius: 3px; font-size: 12px; margin-right: 5px; }
.rdrm-approve-btn { background: #27ae60; color: #fff; border: 1px solid #27ae60; }
.rdrm-approve-btn:hover { background: #219150; color: #fff; }
.rdrm-delete-btn { background: #c0392b; color: #fff; border: 1px solid #c0392b; }
.rdrm-delete-btn:hover { background: #a93226; color: #fff; }