/* ==========================================================================
   RadioBreak Schedule Manager - Shared UI Components
   ========================================================================== */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: var(--success-hover);
}

.btn-secondary {
    background: #374151;
    color: #d1d5db;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-google {
    background: #151821 !important;
    color: #f3f4f6 !important;
    border: 1px solid var(--border-subtle) !important;
    transition: all 0.3s !important;
    border-radius: var(--radius-md) !important;
}

.btn-google:hover {
    background: var(--bg-hover) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-main);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.cron-help {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
    line-height: 1.4;
}

/* Toolbars & Filters */
.filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input {
    min-width: 260px;
    padding: 8px 12px;
    background: #0d0e15;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 13px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-select {
    padding: 8px 10px;
    background: #0d0e15;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 13px;
}

/* Tables */
.files-table,
.adinv-table {
    width: 100%;
    border-collapse: collapse;
    color: #e5e7eb;
    font-size: 13px;
}

.files-table th,
.adinv-table th {
    background: #1b1e2a;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid var(--border-subtle);
    color: #fff;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.files-table td,
.adinv-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.files-table tr:hover,
.adinv-table tr:hover {
    background: var(--bg-hover);
}

.files-container {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 15px;
    max-height: 600px;
    overflow-y: auto;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-subtle);
    font-size: 13px;
    color: var(--text-muted);
}

.pagination-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Badges & Status */
.schedule-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-enabled {
    background: var(--success-bg);
    color: #34d399;
}

.status-disabled {
    background: var(--danger-bg);
    color: #f87171;
}

.tier-pill {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.tier-free {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.tier-premium {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Schedules Cards */
.schedule-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.schedules-grid {
    display: grid;
    gap: 20px;
}

.schedule-card {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s;
}

.schedule-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-color: var(--primary);
}

.schedule-card.disabled {
    opacity: 0.5;
    background: #0d0e15;
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.schedule-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}

.schedule-description {
    color: var(--text-muted);
    margin-bottom: 15px;
}

.schedule-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
    padding: 15px;
    background: #1c1f2e;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.schedule-detail {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.detail-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

.schedule-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* File items */
.file-name {
    color: #60a5fa;
    word-break: break-all;
}

.file-name a {
    color: #60a5fa;
    text-decoration: none;
}

.file-name a:hover {
    text-decoration: underline;
    color: #93c5fd;
}

.file-size,
.file-time {
    color: var(--text-muted);
    white-space: nowrap;
}

.logs-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 14px;
}

/* Ad Inventory */
.adinv-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.adinv-sidebar {
    flex: 0 0 250px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 15px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.adinv-main {
    flex: 1;
    min-width: 0;
}

.folder-tree {
    list-style: none;
    padding-left: 0;
}

.folder-tree ul {
    list-style: none;
    padding-left: 15px;
    border-left: 1px solid var(--border-subtle);
    margin-left: 5px;
}

.folder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    margin: 2px 0;
    border-radius: 6px;
    cursor: pointer;
    color: #e5e7eb;
    transition: all 0.2s;
}

.folder-item:hover {
    background: var(--bg-hover);
}

.folder-item.active {
    background: var(--primary);
    color: white;
}

.folder-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.folder-actions {
    opacity: 0;
    transition: opacity 0.2s;
}

.folder-item:hover .folder-actions {
    opacity: 1;
}
