/* ============================================================
   OWL Downline Builder v1.1.6 — Frontend Styles
   ============================================================ */

/* ── Category Nav Strip ──────────────────────────────────── */
.owl-dlb-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.owl-dlb-nav-item {
    display: inline-block;
    padding: 9px 20px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #ccc !important;
    text-decoration: none !important;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.owl-dlb-nav-item:hover {
    border-color: #00c853;
    color: #00c853 !important;
    background: #0d2d1a;
}

.owl-dlb-nav-active {
    background: #0d2d1a !important;
    border-color: #00c853 !important;
    color: #00c853 !important;
}

/* ── Reorder bar (Directors/admin only) ──────────────────── */
.owl-dlb-reorder-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #1a1a2e;
    border: 1px solid #333;
    border-left: 3px solid #00c853;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.85rem;
}

.owl-dlb-reorder-hint {
    color: #888;
}

.owl-dlb-reorder-saved {
    color: #00c853;
    font-weight: 700;
}

/* ── Wrapper ─────────────────────────────────────────────── */
.owl-dlb-wrap {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 800px;
    margin: 0 auto;
}

/* ── Program Card ────────────────────────────────────────── */
.owl-dlb-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.owl-dlb-card-joined {
    border-color: #00c853;
}

.owl-dlb-card.owl-dlb-sorting {
    box-shadow: 0 8px 24px rgba(0,200,83,0.2);
    opacity: 0.85;
    cursor: grabbing;
}

/* Card Header badges */
.owl-dlb-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px 0;
    flex-wrap: wrap;
    min-height: 10px;
}

.owl-dlb-joined-badge {
    background: rgba(0,200,83,0.15);
    color: #00c853;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.owl-dlb-locked-badge {
    background: rgba(245,158,11,0.15);
    color: #f59e0b;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

.owl-dlb-override-badge {
    background: rgba(139,92,246,0.15);
    color: #a78bfa;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

.owl-dlb-drag-handle {
    margin-left: auto;
    color: #444;
    font-size: 1.2rem;
    cursor: grab;
    user-select: none;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.2s;
}

.owl-dlb-drag-handle:hover {
    color: #00c853;
}

/* Program Name */
.owl-dlb-program-name {
    color: #ffffff !important;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 12px 20px 8px !important;
    padding: 0 !important;
}

.owl-dlb-program-name a {
    color: #ffffff !important;
    text-decoration: none !important;
    transition: color 0.2s;
}

.owl-dlb-program-name a:hover {
    color: #00c853 !important;
}

/* Media */
.owl-dlb-media {
    padding: 16px 20px;
    margin-bottom: 0;
    background: #141414;
    border-top: 1px solid #222;
    border-bottom: 1px solid #222;
}

.owl-dlb-video-wrap {
    position: relative;
    width: 100%;
    max-width: 390px;
    padding-bottom: min(56.25%, 220px);
    height: 0;
    overflow: hidden;
    border-radius: 6px;
}

.owl-dlb-video-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border-radius: 6px;
}

.owl-dlb-program-image {
    max-width: 100%;
    max-height: 200px;
    width: auto;
    height: auto;
    display: block;
    border-radius: 6px;
    object-fit: contain;
}

/* Description */
.owl-dlb-description {
    color: #aaa;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 20px 16px !important;
    padding: 0 !important;
}

/* Actions */
.owl-dlb-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 20px 16px;
    border-top: 1px solid #2a2a2a;
    background: #141414;
    align-items: center;
}

.owl-dlb-upgrade-notice {
    color: #888;
    font-size: 0.85rem;
}

.owl-dlb-upgrade-notice a {
    color: #f59e0b;
    text-decoration: none;
    font-weight: 600;
}

/* ── Inline Forms ────────────────────────────────────────── */
.owl-dlb-join-form,
.owl-dlb-override-form {
    border-top: 1px solid #2a2a2a;
}

.owl-dlb-form-inner {
    padding: 20px;
    background: #111;
}

.owl-dlb-form-inner h4 {
    color: #00c853 !important;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 16px 0 !important;
}

.owl-dlb-form-hint {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 16px !important;
}

.owl-dlb-form-hint code {
    background: #1a1a1a;
    color: #00c853;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
}

.owl-form-group {
    margin-bottom: 16px;
}

.owl-form-group label {
    display: block;
    color: #ccc;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.owl-form-group label small {
    font-weight: normal;
    color: #666;
}

.owl-form-group input[type="text"],
.owl-form-group input[type="url"],
.owl-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 4px;
    color: #fff;
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.owl-form-group input:focus,
.owl-form-group textarea:focus {
    outline: none;
    border-color: #00c853;
}

/* Media Type Toggle */
.owl-dlb-media-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.owl-dlb-media-type-btn {
    opacity: 0.5;
    transition: opacity 0.2s;
}

.owl-dlb-media-type-btn.active {
    opacity: 1;
    background: #00c853 !important;
    color: #000 !important;
    border-color: #00c853 !important;
}

/* Image upload */
.owl-upload-btn {
    display: inline-block;
    background: transparent;
    border: 1px solid #444;
    color: #ccc;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: border-color 0.2s, color 0.2s;
}

.owl-upload-btn:hover {
    border-color: #00c853;
    color: #00c853;
}

.owl-dlb-image-preview {
    margin-bottom: 8px;
}

.owl-dlb-image-preview img {
    max-width: 400px;
    max-height: 300px;
    border-radius: 6px;
    border: 1px solid #333;
}

.owl-upload-progress {
    color: #f59e0b;
    font-size: 0.85rem;
    margin-top: 6px;
}

/* Form actions */
.owl-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.owl-btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid #444;
    background: transparent;
    color: #ccc;
    transition: all 0.2s;
    text-decoration: none;
}

.owl-btn:hover {
    border-color: #00c853;
    color: #00c853;
}

.owl-btn-primary {
    background: #00c853;
    border-color: #00c853;
    color: #000 !important;
}

.owl-btn-primary:hover {
    background: #00e865;
    border-color: #00e865;
}

.owl-btn-sm {
    padding: 6px 12px;
    font-size: 0.78rem;
}

.owl-btn-danger {
    border-color: #c00;
    color: #ff6666 !important;
}

.owl-btn-danger:hover {
    background: #3d1111;
    border-color: #ff6666;
}

.owl-dlb-login-btn {
    border-color: #444;
    color: #888 !important;
}

/* Form messages */
.owl-dlb-form-msg {
    margin-top: 12px;
    font-size: 0.85rem;
}

.owl-success {
    color: #00c853;
}

.owl-error {
    color: #ff6666;
}

/* Empty notice */
.owl-dlb-empty {
    color: #666;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .owl-dlb-actions   { flex-direction: column; }
    .owl-dlb-program-image { max-width: 100%; }
    .owl-dlb-nav       { flex-direction: column; }
}
