/* ============ ADMIN STYLES ============ */

.admin-navbar {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.admin-navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 24px;
    font-weight: bold;
}

.navbar-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============ ADMIN HEADER ============ */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.admin-header h2 {
    font-size: 28px;
    color: #333;
}

/* ============ PAGES LIST ============ */
.pages-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.page-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.page-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-5px);
}

.page-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.page-card-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.published {
    background: #d4edda;
    color: #155724;
}

.status-badge.draft {
    background: #fff3cd;
    color: #856404;
}

.page-slug {
    color: #667eea;
    font-size: 14px;
    margin: 5px 0;
    word-break: break-all;
}

.page-desc {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin: 10px 0;
    overflow-wrap: anywhere;
}

.page-desc-clamp {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.page-meta {
    color: #999;
    font-size: 12px;
    margin: 10px 0;
}

.page-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.page-actions .btn {
    flex: 1;
    min-width: 60px;
    font-size: 12px;
    padding: 8px 10px;
}

/* ============ EDITOR FORM ============ */
.editor-form {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-help {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 12px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'Courier New', monospace;
}

.form-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* ============ CTA ITEMS ============ */
.cta-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #eee;
    transition: all 0.3s ease;
}

.cta-item:hover {
    background: #f0f7ff;
    border-color: #667eea;
}

/* ============ IMPORT OPTIONS ============ */
.import-options {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.import-options .btn {
    flex: 1;
}

.image-preview {
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border: 1px dashed #cfd6e4;
    border-radius: 12px;
    background: #f8fafc;
    color: #667085;
    text-align: center;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 240px;
    border-radius: 10px;
    object-fit: cover;
}

.content-tools-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.content-tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.content-tool-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
}

.content-tool-panel h4 {
    margin-bottom: 12px;
    color: #1f2937;
}

.content-tool-empty {
    color: #667085;
    font-size: 14px;
}

.content-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
}

.content-item:last-child {
    margin-bottom: 0;
}

.content-item-meta {
    margin-bottom: 10px;
    color: #475467;
    font-size: 12px;
    word-break: break-word;
}

.content-item-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.content-item-preview {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-bottom: 10px;
}

.content-inline-input {
    flex: 1 1 260px;
}

/* ============ FORM ACTIONS ============ */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.form-actions .btn {
    flex: 1;
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 16px;
}

.top-space {
    margin-top: 40px;
}

.subscribers-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.subscriber-row {
    display: grid;
    grid-template-columns: 1.2fr 1.4fr 1fr 1fr 180px;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.subscriber-head {
    background: #f8fafc;
    font-weight: 700;
}

.notification-result {
    margin-top: 16px;
}

.dashboard-warning {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
    font-size: 14px;
}

.analytics-filter-form {
    margin-bottom: 24px;
}

.analytics-filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.analytics-card {
    background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
    border: 1px solid #d8e3f2;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.analytics-card strong {
    display: block;
    font-size: 28px;
    color: #1d4ed8;
    margin-top: 8px;
}

.analytics-label {
    color: #475467;
    font-size: 13px;
    font-weight: 600;
}

.analytics-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.analytics-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.analytics-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 120px 90px 90px;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}

.analytics-row span,
.analytics-row a,
.analytics-row small {
    word-break: break-word;
}

.analytics-row-head {
    background: #f8fafc;
    font-weight: 700;
}

.analytics-row-search {
    grid-template-columns: minmax(0, 2fr) 140px 90px;
}

.analytics-row-imports {
    grid-template-columns: minmax(0, 2fr) 110px 110px 110px 110px;
}

.analytics-row-compact {
    grid-template-columns: minmax(0, 1fr) 90px;
}

.top-space-small {
    margin-top: 20px;
}

.link-preview,
.link-preview-empty {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    word-break: break-all;
}

.link-preview {
    background: #eef4ff;
    border: 1px solid #cddcff;
    color: #2b4dbd;
}

.link-preview span {
    font-weight: 600;
}

.link-preview-empty {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    color: #64748b;
}

.notification-success {
    color: #027a48;
}

.notification-error {
    color: #b42318;
}

.manual-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.manual-links a {
    word-break: break-all;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .pages-list {
        grid-template-columns: 1fr;
    }

    .editor-form {
        padding: 20px;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row .form-group {
        width: 100%;
    }

    .page-actions .btn {
        flex: 0 1 calc(50% - 4px);
    }

    .navbar-actions {
        flex-wrap: wrap;
        width: 100%;
    }

    .content-tools-grid {
        grid-template-columns: 1fr;
    }

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

    .analytics-panels {
        grid-template-columns: 1fr;
    }

    .analytics-row,
    .analytics-row-search,
    .analytics-row-imports,
    .analytics-row-compact {
        grid-template-columns: 1fr;
    }

    .analytics-filter-actions {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .admin-navbar .container {
        flex-direction: column;
        gap: 15px;
    }

    .pages-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .page-actions {
        flex-direction: column;
    }

    .page-actions .btn {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}
