/**
 * VMPlayer Admin Styles
 *
 * Styles for the VMPlayer settings page in WordPress admin.
 * Keeps a WordPress-native feel with VMPlayer accent touches.
 *
 * @package VMPlayer
 */

/* ------------------------------------------------------------------
 * Layout
 * --------------------------------------------------------------- */

.vmplayer-admin-wrap {
    max-width: 1200px;
}

.vmplayer-admin-wrap h1 {
    margin-bottom: 1em;
}

.vmplayer-tabs {
    margin-bottom: 1.5em;
}

.vmplayer-tab-content {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-top: none;
    padding: 1.5em 2em;
    margin-top: -1px;
}

.vmplayer-tab-panel {
    min-height: 300px;
}

/* ------------------------------------------------------------------
 * Notice area
 * --------------------------------------------------------------- */

.vmplayer-notice {
    margin: 0 0 1em 0;
    padding: 0;
}

.vmplayer-notice.is-visible {
    padding: 10px 14px;
    border-left: 4px solid #2271b1;
    background: #f0f6fc;
    margin-bottom: 1em;
}

.vmplayer-notice.is-success {
    border-left-color: #00a32a;
    background: #edfaef;
}

.vmplayer-notice.is-error {
    border-left-color: #d63638;
    background: #fcf0f1;
}

/* ------------------------------------------------------------------
 * General tab form
 * --------------------------------------------------------------- */

.vmplayer-form .form-table th {
    width: 220px;
}

.vmplayer-form fieldset label {
    display: inline-block;
    margin-bottom: 0.4em;
    line-height: 1.6;
}

.vmplayer-color-picker {
    max-width: 100px;
}

/* ------------------------------------------------------------------
 * Stations tab
 * --------------------------------------------------------------- */

.vmplayer-stations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5em;
    padding-bottom: 1em;
    border-bottom: 1px solid #dcdcde;
}

.vmplayer-stations-count {
    margin: 0;
    color: #50575e;
    font-size: 14px;
}

.vmplayer-stations-list {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.vmplayer-empty-state {
    text-align: center;
    padding: 3em 1em;
    background: #f6f7f7;
    border: 2px dashed #c3c4c7;
    border-radius: 4px;
    color: #50575e;
}

.vmplayer-empty-state p {
    margin: 0;
    font-size: 14px;
}

/* ------------------------------------------------------------------
 * Station card
 * --------------------------------------------------------------- */

.vmplayer-station-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.vmplayer-station-card.is-collapsed .vmplayer-station-body {
    display: none;
}

.vmplayer-station-card.is-dirty {
    border-left: 4px solid #dba617;
}

.vmplayer-station-card.ui-sortable-helper {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.vmplayer-station-card.ui-sortable-placeholder {
    visibility: visible !important;
    background: #f0f0f1;
    border: 2px dashed #c3c4c7;
    height: 60px;
}

.vmplayer-station-header {
    display: flex;
    align-items: center;
    gap: 0.75em;
    padding: 1em 1.25em;
    background: #f6f7f7;
    border-bottom: 1px solid #dcdcde;
    cursor: pointer;
}

.vmplayer-station-card.is-collapsed .vmplayer-station-header {
    border-bottom: none;
}

.vmplayer-drag-handle {
    cursor: move;
    color: #8c8f94;
    font-size: 18px;
    line-height: 1;
    padding: 0.25em;
    user-select: none;
}

.vmplayer-drag-handle:hover {
    color: #2271b1;
}

.vmplayer-station-title {
    flex: 1;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.vmplayer-station-meta {
    color: #50575e;
    font-size: 13px;
    font-weight: normal;
    margin-left: 0.5em;
}

.vmplayer-station-toggle {
    background: transparent;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    padding: 0.25em 0.6em;
    cursor: pointer;
    font-size: 12px;
}

.vmplayer-station-toggle:hover {
    background: #f0f0f1;
}

.vmplayer-station-body {
    padding: 1.5em;
}

.vmplayer-station-body .form-table {
    margin: 0;
}

.vmplayer-station-body .form-table th {
    width: 180px;
}

.vmplayer-station-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5em;
    padding: 1em 1.5em;
    background: #f6f7f7;
    border-top: 1px solid #dcdcde;
}

.vmplayer-station-actions-left,
.vmplayer-station-actions-right {
    display: flex;
    gap: 0.5em;
    align-items: center;
}

/* ------------------------------------------------------------------
 * Logo preview
 * --------------------------------------------------------------- */

.vmplayer-logo-field {
    display: flex;
    align-items: center;
    gap: 1em;
}

.vmplayer-logo-preview {
    width: 80px;
    height: 80px;
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.vmplayer-logo-preview.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8c8f94;
    font-size: 12px;
    text-align: center;
    padding: 0.5em;
}

.vmplayer-logo-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.4em;
}

/* ------------------------------------------------------------------
 * Mount list editor
 * --------------------------------------------------------------- */

.vmplayer-mounts {
    display: flex;
    flex-direction: column;
    gap: 0.6em;
}

.vmplayer-mount-row {
    display: grid;
    grid-template-columns: 1fr 2fr 90px 90px auto;
    gap: 0.6em;
    align-items: center;
    padding: 0.6em;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 3px;
}

.vmplayer-mount-row input[type="text"],
.vmplayer-mount-row input[type="number"],
.vmplayer-mount-row select {
    width: 100%;
    margin: 0;
}

.vmplayer-mount-remove {
    color: #b32d2e;
    background: transparent;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    padding: 0.25em 0.6em;
    cursor: pointer;
    font-size: 12px;
}

.vmplayer-mount-remove:hover {
    background: #fcf0f1;
    border-color: #d63638;
}

.vmplayer-add-mount {
    align-self: flex-start;
    margin-top: 0.4em;
}

/* ------------------------------------------------------------------
 * Stream type radio group
 * --------------------------------------------------------------- */

.vmplayer-stream-types {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2em;
}

.vmplayer-stream-types label {
    display: flex;
    align-items: center;
    gap: 0.3em;
}

/* ------------------------------------------------------------------
 * Test connection button
 * --------------------------------------------------------------- */

.vmplayer-test-wrap {
    margin-top: 0.6em;
}

.vmplayer-test-stream {
    margin-left: 0.5em !important;
}

.vmplayer-test-result {
    display: inline-block;
    margin-left: 0.5em;
    padding: 0.2em 0.6em;
    border-radius: 3px;
    font-size: 12px;
}

.vmplayer-test-result.is-success {
    background: #edfaef;
    color: #00691f;
    border: 1px solid #b8e6c0;
}

.vmplayer-test-result.is-error {
    background: #fcf0f1;
    color: #8a1f1f;
    border: 1px solid #f5c2c5;
}

.vmplayer-test-result.is-testing {
    background: #f0f6fc;
    color: #2271b1;
    border: 1px solid #c3d9ee;
}

/* ------------------------------------------------------------------
 * Social URLs grid
 * --------------------------------------------------------------- */

.vmplayer-social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1em;
}

.vmplayer-social-field {
    display: flex;
    flex-direction: column;
    gap: 0.35em;
}

.vmplayer-social-label {
    font-weight: 600;
    font-size: 13px;
}

.vmplayer-social-row {
    display: flex;
    align-items: stretch;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}

.vmplayer-social-row:focus-within {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.vmplayer-social-prefix {
    padding: 6px 8px;
    background: #f6f7f7;
    color: #646970;
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    display: flex;
    align-items: center;
    border-right: 1px solid #dcdcde;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vmplayer-social-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 6px 8px;
    font-size: 14px;
    min-width: 0;
    background: transparent;
}

.vmplayer-social-input:focus {
    box-shadow: none !important;
    outline: none !important;
}

.vmplayer-social-hint {
    margin: 0;
    color: #646970;
    font-size: 12px;
    font-style: italic;
    line-height: 1.4;
}

/* ------------------------------------------------------------------
 * About tab
 * --------------------------------------------------------------- */

.vmplayer-about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5em;
}

.vmplayer-about-card {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 1.5em;
}

.vmplayer-about-card h2 {
    margin-top: 0;
    font-size: 16px;
}

.vmplayer-about-facts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.vmplayer-about-facts li {
    padding: 0.4em 0;
    border-bottom: 1px solid #dcdcde;
}

.vmplayer-about-facts li:last-child {
    border-bottom: none;
}

.vmplayer-shortcode {
    display: inline-block;
    padding: 0.4em 0.8em;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    font-size: 14px;
}

.vmplayer-about-premium {
    border-left: 4px solid #a855f7;
}

/* ------------------------------------------------------------------
 * Credits and sponsor blocks on the About tab
 * --------------------------------------------------------------- */

.vmplayer-about-credits {
    text-align: center;
}

.vmplayer-about-credits h2 {
    text-align: left;
}

.vmplayer-credits-logo-link {
    display: inline-block;
    line-height: 0;
    border-radius: 8px;
    transition: transform 0.15s;
    margin: 4px 0 12px 0;
}

.vmplayer-credits-logo-link:hover {
    transform: translateY(-1px);
}

.vmplayer-credits-logo-link:focus {
    outline: 2px solid #a855f7;
    outline-offset: 3px;
}

.vmplayer-credits-logo {
    display: block;
    width: 110px;
    height: auto;
    border-radius: 6px;
}

.vmplayer-credits-line {
    margin: 0 0 10px 0;
    font-weight: 600;
    font-size: 14px;
    color: #1e1e1e;
}

.vmplayer-credits-description {
    margin: 0;
    color: #50575e;
    font-size: 12.5px;
    line-height: 1.55;
    text-align: center;
}

.vmplayer-about-sponsor {
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
}

.vmplayer-sponsor-label {
    margin: 0 0 8px 0;
    font-size: 11px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #b45309;
    font-weight: 700;
}

.vmplayer-sponsor-link {
    display: block;
    line-height: 0;
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.15s;
}

.vmplayer-sponsor-link:hover {
    transform: translateY(-1px);
}

.vmplayer-sponsor-banner {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
}

.vmplayer-sponsor-caption {
    margin: 10px 0 0 0;
    font-size: 12px;
    color: #78350f;
    line-height: 1.5;
}

/* ------------------------------------------------------------------
 * Help tab
 * --------------------------------------------------------------- */

.vmplayer-help-wrap {
    max-width: 900px;
}

.vmplayer-help-intro {
    background: #fff;
    padding: 24px;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    margin-bottom: 20px;
}

.vmplayer-help-intro h2 {
    margin-top: 0;
}

.vmplayer-help-intro p {
    margin-bottom: 0;
    color: #50575e;
    line-height: 1.6;
}

.vmplayer-help-section {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
}

.vmplayer-help-section > summary {
    padding: 16px 20px;
    cursor: pointer;
    background: #f6f7f7;
    border-bottom: 1px solid transparent;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}

.vmplayer-help-section > summary::-webkit-details-marker {
    display: none;
}

.vmplayer-help-section > summary::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 6px solid #646970;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform 0.15s;
}

.vmplayer-help-section[open] > summary::before {
    transform: rotate(90deg);
}

.vmplayer-help-section[open] > summary {
    border-bottom-color: #dcdcde;
    background: #fff;
}

.vmplayer-help-section > summary h3 {
    display: inline;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.vmplayer-help-body {
    padding: 20px 24px;
    line-height: 1.6;
    color: #1e1e1e;
}

.vmplayer-help-body h4 {
    font-size: 14px;
    margin: 20px 0 6px 0;
    color: #1e1e1e;
}

.vmplayer-help-body h4:first-child {
    margin-top: 0;
}

.vmplayer-help-body ol {
    margin: 0 0 0 24px;
    padding: 0;
}

.vmplayer-help-body ol li {
    margin-bottom: 14px;
}

.vmplayer-help-body ol li strong {
    display: block;
    margin-bottom: 2px;
}

.vmplayer-help-body p {
    margin: 0 0 10px 0;
}

.vmplayer-help-body code {
    background: #f6f7f7;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 13px;
    margin-right: 6px;
    color: #a855f7;
}

.vmplayer-help-footer {
    text-align: center;
    padding: 16px;
    color: #646970;
    font-size: 13px;
    margin-top: 16px;
}

.vmplayer-help-footer a {
    color: #a855f7;
    text-decoration: none;
    font-weight: 600;
}

.vmplayer-help-footer a:hover {
    text-decoration: underline;
}

/* ------------------------------------------------------------------
 * Utility
 * --------------------------------------------------------------- */

.is-hidden {
    display: none !important;
}

/* ------------------------------------------------------------------
 * Responsive
 * --------------------------------------------------------------- */

@media screen and (max-width: 782px) {
    .vmplayer-tab-content {
        padding: 1em;
    }

    .vmplayer-stations-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8em;
    }

    .vmplayer-mount-row {
        grid-template-columns: 1fr;
    }

    .vmplayer-station-body .form-table th {
        width: auto;
    }
}

/* ==========================================================================
   Per-station live detection and listener count fields
   ========================================================================== */

.vmplayer-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.4;
}

.vmplayer-live-detection,
.vmplayer-listener-count-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vmplayer-field-hint {
    margin: 4px 0 6px;
    color: #6b7280;
    font-style: italic;
    font-size: 12px;
    line-height: 1.4;
}

.vmplayer-live-keywords-label {
    font-weight: 500;
    font-size: 13px;
    margin-top: 4px;
}

.vmplayer-live-keywords-input {
    max-width: 100%;
}

.vmplayer-live-keywords-input:disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}
