/******************************************************************************
 * Social Media Queues
 * Base stylesheet
 ******************************************************************************/


/* ------------------------------------------------------------
   Base
------------------------------------------------------------ */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
    background: #f5f5f5;
    color: #222;
}

header {
    padding: 1rem 2rem;
    background: #222;
    color: #fff;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    color: #666;
}


/* ------------------------------------------------------------
   Application Header
------------------------------------------------------------ */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1rem 2rem;
}

.app-header-main {
    display: flex;
    align-items: center;
    gap: 2rem;
    min-width: 0;
}

.app-brand {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    white-space: nowrap;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.app-nav a {
    display: block;
    padding: 0.45rem 0.7rem;
    color: #ddd;
    text-decoration: none;
    white-space: nowrap;
}

.app-nav a:hover {
    background: #444;
    color: #fff;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.header-user form {
    margin: 0;
}

.header-logout {
    padding: 0.4rem 0.75rem;
    border: 1px solid #fff;
    background: transparent;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.header-logout:hover {
    background: #fff;
    color: #222;
}


/* ------------------------------------------------------------
   Page & Section Headers
------------------------------------------------------------ */

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}


/* ------------------------------------------------------------
   Dashboard
------------------------------------------------------------ */

.dashboard-section {
    margin-bottom: 2.5rem;
}


/* ------------------------------------------------------------
   Status Cards
------------------------------------------------------------ */

.status-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

.status-card {
    padding: 1.25rem;
    border: 1px solid #bbb;
    background: #fff;
    text-align: center;
}

.status-number {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
}

.status-label {
    display: block;
    font-size: 0.9rem;
}


/* ------------------------------------------------------------
   Buttons & Links
------------------------------------------------------------ */

.button {
    display: inline-block;
    padding: 0.65rem 1rem;
    border: 1px solid #222;
    background: #222;
    color: #fff;
    text-decoration: none;
}

.button:hover {
    background: #fff;
    color: #222;
}

button.button {
    cursor: pointer;
    font: inherit;
}

.button-secondary {
    background: #fff;
    color: #222;
}

.button-secondary:hover {
    background: #222;
    color: #fff;
}

.text-link {
    color: #222;
}


/* ------------------------------------------------------------
   Tables
------------------------------------------------------------ */

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 0.75rem;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

th {
    background: #222;
    color: #fff;
}


/* ------------------------------------------------------------
   Empty State
------------------------------------------------------------ */

.empty-state {
    padding: 2rem;
    border: 1px solid #ccc;
    background: #fff;
}

.empty-state p:first-child {
    margin-top: 0;
    font-weight: bold;
}

.empty-state p:last-child {
    margin-bottom: 0;
}


/* ------------------------------------------------------------
   Forms
------------------------------------------------------------ */

.queue-form {
    max-width: 1000px;
}

.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid #ccc;
    background: #fff;
}

.form-section h2 {
    margin-top: 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #ddd;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group-wide {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #aaa;
    background: #fff;
    color: #222;
    font: inherit;
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: 2px solid #222;
    outline-offset: 1px;
}

.form-group small {
    color: #666;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.form-errors {
    max-width: 1000px;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    border: 2px solid #222;
    background: #fff;
}

.form-errors ul {
    margin-bottom: 0;
}

.queue-filter-section {
    max-width: none;
}

.queue-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.queue-filter-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.queue-result-count {
    margin: 0.25rem 0 0;
    color: #666;
}

.publishing-filter-section {
    max-width: none;
}

.publishing-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.publishing-filter-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.publishing-result-count {
    margin: 0.25rem 0 0;
    color: #666;
}

.publishing-error {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: #a00;
}

.manual-publishing-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.manual-publishing-target {
    padding: 1.25rem 0;
    border-bottom: 1px solid #ddd;
}

.manual-publishing-target:first-child {
    padding-top: 0;
}

.manual-publishing-target:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.manual-publishing-target form {
    margin-top: 1rem;
}

/* ------------------------------------------------------------
   Source Details
------------------------------------------------------------ */

.source-details {
    display: grid;
    gap: 0.4rem;
}

.source-detail-row {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 0.75rem;
    align-items: baseline;
}

.source-detail-row strong {
    margin: 0;
}

.source-detail-row span {
    min-width: 0;
    overflow-wrap: anywhere;
}


/* ------------------------------------------------------------
   Sources Hub
------------------------------------------------------------ */

.source-project {
    margin-bottom: 3rem;
}

.source-project .section-header {
    margin-bottom: 1rem;
}

.source-project .section-header h2 {
    margin-top: 0;
    margin-bottom: 0.25rem;
}

.source-project .section-header p {
    margin: 0;
    color: #666;
}

.source-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.source-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
    padding: 1.5rem;
    border: 1px solid #ccc;
    background: #fff;
    color: #222;
    text-decoration: none;
}

.source-card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.source-card p {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #555;
}

.source-card-active {
    border-top: 4px solid #222;
}

.source-card-active:hover {
    border-color: #222;
    background: #f0f0f0;
}

.source-card-action {
    font-weight: bold;
}

.source-card-coming {
    background: #eee;
    color: #666;
}

.source-card-coming p {
    color: #777;
}

.source-card-status {
    align-self: flex-start;
    padding: 0.3rem 0.55rem;
    background: #ddd;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}


/* ------------------------------------------------------------
   Queue Item Workspace
------------------------------------------------------------ */

.workspace-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 2rem;
    margin-bottom: 0.8rem;
}

.source-record {
    padding-top: 0.75rem;
    border-top: 1px solid #ddd;
}

.source-record-title {
    margin-bottom: 0.15rem;
    font-size: 1.1rem;
    font-weight: bold;
}

.source-location {
    margin-bottom: 0.65rem;
}

.source-links {
    display: grid;
    gap: 0.25rem;
}

.source-links strong {
    display: inline-block;
    width: 55px;
    margin-right: 0.35rem;
}

.editorial-display {
    display: grid;
    gap: 0.75rem;
}

.editorial-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
}

.editorial-post > div {
    line-height: 1.6;
}


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

@media (max-width: 900px) {

    .app-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.75rem;
    }

    .app-header-main {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }

    .app-nav {
        flex-wrap: wrap;
    }

    .header-user {
        width: 100%;
        justify-content: space-between;
    }

    .status-grid {
        grid-template-columns: repeat(3, 1fr);
    }

}


@media (max-width: 700px) {

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group-wide {
        grid-column: auto;
    }

    .source-detail-row {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }

    .source-card-grid {
        grid-template-columns: 1fr;
    }

    .workspace-meta {
        grid-template-columns: 1fr;
    }

    .editorial-row {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .queue-filter-grid {
        grid-template-columns: 1fr;
    }

    .publishing-filter-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 600px) {

    main {
        padding: 1rem;
    }

    .app-header {
        padding: 0.75rem 1rem;
    }

    .app-nav {
        gap: 0;
    }

    .app-nav a {
        padding: 0.4rem 0.55rem;
    }

    .header-user {
        font-size: 0.8rem;
    }

    .section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .status-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}