﻿.hero-banner {
    margin: 0; /* remove any default page padding */
}

    .hero-banner img {
        display: block;
        width: 100%;
        height: auto;
    }

/* Header row with title on the left, actions on the right (match challenge page) */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0 1.5rem; /* space above and below */
    padding: 0 1rem; /* horizontal padding to match page gutters */
}

    /* Title */
    .header-row .page-title {
        font-size: 2rem;
        font-weight: 700;
        margin: 0;
    }

/* Button base style — same as challenge.css */
.challenge-owner-actions .btn {
    display: inline-flex; /* shrink-to-contents */
    align-items: center;
    justify-content: center;
    gap: 8px; /* icon/text gap */
    padding: 10px 16px; /* 10px vertical, 16px horizontal */
    border-radius: 8px;
    border: 1px solid #D5D7DA; /* var(--Gray-300) */
    background: #FFF; /* var(--White) */
    box-shadow: 0px 1px 2px rgba(10, 13, 18, 0.05);
    text-decoration: none;
    font-weight: 500;
    color: #181D27; /* var(--Gray-900) */
    font-size: 14px;
    transition: background-color 0.2s, border-color 0.2s;
}

    .challenge-owner-actions .btn:hover {
        background-color: #F5F5F5; /* var(--Gray-100) */
    }

/* Primary button */
.challenge-owner-actions .btn-primary {
    background-color: #4DC24D; /* brand green */
    border-color: #4DC24D;
    color: #fff;
}

    .challenge-owner-actions .btn-primary:hover {
        background-color: #3DB43D;
        border-color: #3DB43D;
    }

/* Secondary button */
.challenge-owner-actions .btn-secondary {
    background-color: transparent;
    color: #717680; /* var(--Gray-700) */
}

    .challenge-owner-actions .btn-secondary:hover {
        background-color: #F5F5F5; /* var(--Gray-100) */
    }

/* Simple content gutter alignment for any future modules */
.draft-dashboard-content {
    padding: 0 1rem 2rem 1rem;
}

/* Role-gated visibility:
   - Manager buttons hidden by default; JS will reveal if role flags say so.
*/
[data-requires-manager="true"] {
    display: none;
}

/* Responsive tweaks */
@media (max-width: 600px) {
    .header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .challenge-owner-actions {
        margin-top: 1rem;
        flex-wrap: wrap;
    }

        .challenge-owner-actions .btn-secondary {
            flex: 1 1 100%;
            text-align: center;
        }
}

/* =========================
   Draft Dashboard Layout
   ========================= */

.draft-dashboard-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.draft-order-panel {
    flex: 0 0 280px;
    min-width: 250px;
    max-width: 320px;
    background: #FFF;
    border: 1px solid #D5D7DA;
    border-radius: 12px;
    box-shadow: 0px 1px 2px rgba(10, 13, 18, 0.05);
    padding: 16px;
}

.draft-main-content {
    flex: 1 1 auto;
    min-width: 0;
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
    .draft-dashboard-layout {
        flex-direction: column;
    }

    .draft-order-panel {
        flex: none;
        width: 100%;
        max-width: none;
    }
}

/* =========================
   Draft Order Panel
   ========================= */

.draft-order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.draft-order-title {
    font-size: 16px;
    font-weight: 700;
    color: #181D27;
    margin: 0;
}

.draft-order-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #FEF3C7;
    border: 1px solid #F59E0B;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    color: #92400E;
}

.draft-order-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.draft-order-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #FAFAFA;
    border: 1px solid #EAECF0;
    border-radius: 8px;
    transition: background-color 0.15s, box-shadow 0.15s;
}

    .draft-order-item:hover {
        background: #F5F5F5;
    }

    .draft-order-item.swap-selected {
        background: rgba(22, 163, 74, 0.12);
        box-shadow: inset 0 0 0 2px rgba(22, 163, 74, 0.4);
    }

.draft-order-position {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #181D27;
    color: #FFF;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.draft-order-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #D5D7DA;
    flex-shrink: 0;
}

.draft-order-name {
    flex: 1 1 auto;
    font-size: 14px;
    font-weight: 500;
    color: #181D27;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.draft-order-swap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.15s;
    flex-shrink: 0;
}

    .draft-order-swap-btn:hover {
        background: rgba(22, 163, 74, 0.15);
    }

    .draft-order-swap-btn svg {
        display: block;
    }

/* Swap controls at bottom of panel */
.draft-order-swap-controls {
    margin-top: 12px;
}

.draft-order-swap-error {
    padding: 8px 10px;
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    border-radius: 8px;
    color: #991B1B;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.draft-order-swap-controls .btn-success {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: #4DC24D;
    border: 1px solid #4DC24D;
    border-radius: 8px;
    color: #FFF;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.15s;
}

    .draft-order-swap-controls .btn-success:hover {
        background: #3DB43D;
        border-color: #3DB43D;
    }

    .draft-order-swap-controls .btn-success:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* =========================
   Draft Schedule UI
   ========================= */

.draft-schedule-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid #D5D7DA;
    border-radius: 12px;
    background: #FFF;
    box-shadow: 0px 1px 2px rgba(10, 13, 18, 0.05);
    margin-top: 8px;
}

.draft-schedule-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
}

.draft-schedule-title {
    font-weight: 700;
    color: #181D27;
    font-size: 14px;
}

.draft-schedule-when {
    font-weight: 700;
    color: #181D27;
    font-size: 16px;
}

.draft-schedule-tz {
    color: #717680;
    font-size: 13px;
}

.draft-schedule-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.draft-countdown-label {
    color: #717680;
    font-size: 13px;
}

.draft-countdown {
    font-weight: 800;
    font-size: 18px;
    color: #181D27;
    letter-spacing: .2px;
}

.draft-schedule-empty {
    margin-top: 8px;
    padding: 12px 14px;
    border: 1px dashed #D5D7DA;
    border-radius: 12px;
    color: #717680;
    background: #FFF;
}

/* =========================
   Draft Scheduled Card (Three Column)
   ========================= */

.draft-scheduled-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.1);
}

.draft-scheduled-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1 1 0;
    min-width: 0;
}

.draft-scheduled-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #22c55e;
    border-radius: 12px;
    flex-shrink: 0;
}

    .draft-scheduled-icon svg {
        stroke: white;
    }

.draft-scheduled-info {
    min-width: 0;
}

.draft-scheduled-label {
    font-size: 13px;
    font-weight: 600;
    color: #16a34a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.draft-scheduled-datetime {
    font-size: 20px;
    font-weight: 700;
    color: #166534;
    margin-bottom: 2px;
}

.draft-scheduled-tz {
    font-size: 13px;
    color: #15803d;
}

.draft-scheduled-center {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

    .draft-scheduled-center .draft-countdown-label {
        color: #16a34a;
        font-weight: 500;
        font-size: 14px;
        white-space: nowrap;
    }

    .draft-scheduled-center .draft-countdown {
        font-size: 22px;
        font-weight: 800;
        color: #166534;
        background: rgba(255, 255, 255, 0.7);
        padding: 8px 16px;
        border-radius: 8px;
        border: 1px solid rgba(34, 197, 94, 0.3);
        white-space: nowrap;
    }

.draft-scheduled-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 0;
    min-width: 80px;
}

/* Cancel Schedule Button */
.btn-cancel-schedule {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #dc2626;
    background: #fff;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

    .btn-cancel-schedule:hover {
        background: #fef2f2;
        border-color: #f87171;
        color: #b91c1c;
    }

    .btn-cancel-schedule:active {
        background: #fee2e2;
    }

/* Responsive adjustments for scheduled card */
@media (max-width: 768px) {
    .draft-scheduled-card {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .draft-scheduled-left {
        flex: none;
        justify-content: flex-start;
    }

    .draft-scheduled-center {
        justify-content: center;
    }

        .draft-scheduled-center .draft-countdown {
            text-align: center;
        }

    .draft-scheduled-right {
        flex: none;
        justify-content: center;
    }

    .btn-cancel-schedule {
        width: 100%;
    }
}

/* =========================
   Modal
   ========================= */

.ft-modal-backdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
}

.ft-modal {
    width: 100%;
    max-width: 520px;
    background: #FFF;
    border-radius: 14px;
    border: 1px solid #D5D7DA;
    box-shadow: 0 10px 25px rgba(0,0,0,.18);
    overflow: hidden;
}

.ft-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #EAECF0;
}

.ft-modal-title {
    font-size: 16px;
    font-weight: 800;
    color: #181D27;
}

.ft-modal-close {
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #717680;
    padding: 0 4px;
}

.ft-modal-body {
    padding: 16px;
}

.ft-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid #EAECF0;
    background: #FFF;
}

.ft-form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.ft-label {
    font-weight: 700;
    font-size: 13px;
    color: #181D27;
}

.ft-input,
.ft-select {
    width: 100%;
    height: 38px;
    border-radius: 10px;
    border: 1px solid #D5D7DA;
    padding: 8px 10px;
    font-size: 14px;
    color: #181D27;
    background: #FFF;
}

.ft-modal-help {
    margin-top: 8px;
    color: #717680;
    font-size: 13px;
}

.ft-modal-error {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #FCA5A5;
    background: #FEF2F2;
    color: #991B1B;
    font-weight: 700;
    font-size: 13px;
}

/* =========================
   Button States
   ========================= */

.challenge-owner-actions .btn.ft-enabled {
    color: #181D27;
    cursor: pointer;
}

.challenge-owner-actions .btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* =========================
   Draft Complete Card
   ========================= */

.draft-complete-card {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
}

.draft-complete-content {
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
}

.draft-complete-icon {
    flex-shrink: 0;
}

.draft-complete-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.draft-complete-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* =========================
   Draft In Progress Card
   ========================= */

.draft-in-progress-card {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
}

.draft-in-progress-content {
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
}

.draft-in-progress-icon {
    flex-shrink: 0;
}

.draft-in-progress-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.draft-in-progress-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* =========================
   Reset Draft Button
   ========================= */

.challenge-owner-actions .btn-danger {
    background-color: #dc2626;
    border-color: #dc2626;
    color: white;
}

    .challenge-owner-actions .btn-danger:hover:not([aria-disabled="true"]):not(:disabled) {
        background-color: #b91c1c;
        border-color: #b91c1c;
    }

    .challenge-owner-actions .btn-danger[aria-disabled="true"],
    .challenge-owner-actions .btn-danger:disabled {
        background-color: #9ca3af;
        border-color: #9ca3af;
        cursor: not-allowed;
        opacity: 0.6;
    }

/* =========================
   Reset Modal Warning
   ========================= */

.ft-modal-warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    margin-bottom: 16px;
    color: #92400e;
}

    .ft-modal-warning svg {
        flex-shrink: 0;
        color: #f59e0b;
    }

.ft-modal-body ul {
    margin: 8px 0 16px 20px;
    padding: 0;
}

    .ft-modal-body ul li {
        margin-bottom: 4px;
    }

/* =========================
   Modal Button Styles
   ========================= */

.ft-modal-footer .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ft-modal-footer .btn-secondary {
    background: #fff;
    border: 1px solid #D5D7DA;
    color: #717680;
}

    .ft-modal-footer .btn-secondary:hover {
        background: #f5f5f5;
    }

.ft-modal-footer .btn-primary {
    background: #4DC24D;
    border: 1px solid #4DC24D;
    color: #fff;
}

    .ft-modal-footer .btn-primary:hover {
        background: #3DB43D;
        border-color: #3DB43D;
    }

.ft-modal-footer .btn-danger {
    background: #dc2626;
    border: 1px solid #dc2626;
    color: #fff;
}

    .ft-modal-footer .btn-danger:hover {
        background: #b91c1c;
        border-color: #b91c1c;
    }

    .ft-modal-footer .btn-danger:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }
