/* ═══════════════════════════════════════════════════
   AutoSMM Content Plans — pages styles
   BEM naming: cp- prefix (content-plans)
   Reuses sh- design system variables
   ═══════════════════════════════════════════════════ */

:root {
    --sh-primary: #0F33EF;
    --sh-primary-light: #4A6CF7;
    --sh-primary-bg: #f0f4ff;
    --sh-success: #22c55e;
    --sh-warning: #f59e0b;
    --sh-danger: #ef4444;
    --sh-text: #1a1a1a;
    --sh-text-muted: #6c757d;
    --sh-text-secondary: #8b95a5;
    --sh-border: #e5e7eb;
    --sh-bg: #f8f9fb;
    --sh-card-bg: #ffffff;
    --sh-radius: 16px;
    --sh-radius-sm: 10px;
    --sh-radius-xs: 8px;
    --sh-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --sh-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --sh-transition: 0.2s ease;
}

/* ─── Page Layout ─── */

.cp-page {
    min-height: 100vh;
    background: var(--sh-bg);
    padding: 0;
}

.cp-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 24px 40px;
}

/* ─── Header ─── */

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

.cp-header__left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cp-header__title {
    font-family: 'Unbounded', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--sh-text);
    margin: 0;
}

.cp-header__title span {
    color: var(--sh-primary);
}

/* ─── Back Link ─── */

.cp-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--sh-primary);
    text-decoration: none;
    margin-bottom: 16px;
    transition: opacity var(--sh-transition);
}

.cp-back:hover {
    opacity: 0.75;
}

.cp-back i {
    font-size: 13px;
}

/* ─── Section Title ─── */

.cp-section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--sh-text);
    margin: 0 0 8px;
}

.cp-section-desc {
    font-size: 14px;
    color: var(--sh-text-muted);
    margin: 0 0 20px;
    line-height: 1.5;
}

/* ─── Buttons ─── */

.cp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--sh-radius-sm);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--sh-transition), box-shadow var(--sh-transition), opacity var(--sh-transition);
    text-decoration: none;
    line-height: 1.4;
}

.cp-btn:hover {
    transform: translateY(-1px);
}

.cp-btn:active {
    transform: translateY(0);
}

.cp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.cp-btn--primary {
    background: linear-gradient(135deg, var(--sh-primary) 0%, var(--sh-primary-light) 100%);
    color: #fff;
}

.cp-btn--primary:hover {
    box-shadow: 0 4px 16px rgba(15, 51, 239, 0.3);
}

.cp-btn--secondary {
    background: var(--sh-card-bg);
    color: var(--sh-text);
    border: 1px solid var(--sh-border);
}

.cp-btn--ghost {
    background: transparent;
    color: var(--sh-text-muted);
    padding: 10px 16px;
}

.cp-btn--ghost:hover {
    color: var(--sh-text);
    background: var(--sh-bg);
    transform: none;
}

.cp-btn--sm {
    padding: 8px 14px;
    font-size: 13px;
}

.cp-btn--lg {
    padding: 14px 28px;
    font-size: 15px;
}

/* ─── Cards ─── */

.cp-card {
    background: var(--sh-card-bg);
    border-radius: var(--sh-radius);
    padding: 20px 24px;
    box-shadow: var(--sh-shadow);
    border: 1px solid var(--sh-border);
    margin-bottom: 12px;
    transition: transform var(--sh-transition), box-shadow var(--sh-transition);
}

.cp-card:hover {
    box-shadow: var(--sh-shadow-hover);
}

.cp-card--clickable {
    cursor: pointer;
}

.cp-card--clickable:hover {
    transform: translateY(-2px);
}

/* ─── Feed (list) Cards ─── */

.cp-feed-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.cp-feed-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--sh-primary-bg);
    color: var(--sh-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.cp-feed-card__content {
    flex: 1;
    min-width: 0;
}

.cp-feed-card__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--sh-text);
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cp-feed-card__title a {
    color: inherit;
    text-decoration: none;
}

.cp-feed-card__title a:hover {
    color: var(--sh-primary);
}

.cp-feed-card__preview {
    font-size: 13px;
    color: var(--sh-text-muted);
    line-height: 1.5;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cp-feed-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cp-feed-card__date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--sh-text-secondary);
}

.cp-feed-card__date i {
    font-size: 12px;
}

.cp-feed-card__action {
    margin-left: auto;
}

/* ─── Badges ─── */

.cp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.cp-badge--primary {
    background: var(--sh-primary-bg);
    color: var(--sh-primary);
}

.cp-badge--success {
    background: #dcfce7;
    color: #16a34a;
}

.cp-badge--warning {
    background: #fef3c7;
    color: #d97706;
}

.cp-badge--muted {
    background: #f3f4f6;
    color: var(--sh-text-muted);
}

/* ─── Plan View ─── */

.cp-plan-info {
    background: var(--sh-primary-bg);
    border: 2px solid var(--sh-primary);
    border-radius: var(--sh-radius);
    padding: 20px 24px;
    margin-bottom: 24px;
}

.cp-plan-info__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--sh-text);
    margin: 0 0 12px;
}

.cp-plan-info__row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--sh-text);
}

.cp-plan-info__label {
    font-weight: 600;
    color: var(--sh-text-muted);
    font-size: 13px;
}

/* ─── Day Card ─── */

.cp-day-card {
    background: var(--sh-card-bg);
    border-radius: var(--sh-radius);
    padding: 24px;
    box-shadow: var(--sh-shadow);
    border: 1px solid var(--sh-border);
    margin-bottom: 16px;
    transition: box-shadow var(--sh-transition);
}

.cp-day-card:hover {
    box-shadow: var(--sh-shadow-hover);
}

.cp-day-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.cp-day-card__number {
    font-family: 'Unbounded', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--sh-primary);
    margin: 0;
}

.cp-day-card__content {
    font-size: 14px;
    color: var(--sh-text);
    line-height: 1.65;
    margin-bottom: 16px;
}

.cp-day-card__content p {
    margin: 0 0 8px;
}

.cp-day-card__content p:last-child {
    margin-bottom: 0;
}

.cp-day-card__media {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--sh-radius-xs);
    padding: 12px 16px;
    margin-bottom: 16px;
}

.cp-day-card__media-label {
    font-size: 12px;
    font-weight: 600;
    color: #16a34a;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cp-day-card__media-text {
    font-size: 13px;
    color: var(--sh-text);
    line-height: 1.5;
    margin: 0;
}

.cp-day-card__media-text p {
    margin: 0;
}

.cp-day-card__footer {
    display: flex;
    justify-content: flex-end;
}

/* ─── Plan Footer Tip ─── */

.cp-plan-tip {
    background: var(--sh-card-bg);
    border-radius: var(--sh-radius);
    padding: 20px 24px;
    box-shadow: var(--sh-shadow);
    border: 1px solid var(--sh-border);
    margin-top: 8px;
}

.cp-plan-tip p {
    font-size: 13px;
    color: var(--sh-text-muted);
    line-height: 1.6;
    margin: 0;
}

.cp-plan-tip i {
    color: var(--sh-warning);
    margin-right: 6px;
}

/* ─── Create Form ─── */

.cp-create-form {
    background: var(--sh-card-bg);
    border-radius: var(--sh-radius);
    padding: 28px 28px;
    box-shadow: var(--sh-shadow);
    border: 1px solid var(--sh-border);
    margin-bottom: 24px;
}

.cp-create-form__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--sh-text);
    margin: 0 0 6px;
}

.cp-create-form__subtitle {
    font-size: 14px;
    color: var(--sh-text-muted);
    margin: 0 0 20px;
}

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

.cp-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--sh-text);
    margin-bottom: 6px;
}

.cp-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius-xs);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: var(--sh-text);
    background: var(--sh-card-bg);
    transition: border-color var(--sh-transition), box-shadow var(--sh-transition);
    box-sizing: border-box;
    resize: vertical;
    min-height: 120px;
}

.cp-textarea:focus {
    outline: none;
    border-color: var(--sh-primary);
    box-shadow: 0 0 0 3px rgba(15, 51, 239, 0.12);
}

.cp-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* ─── Rate Limit Warning ─── */

.cp-rate-limit {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: var(--sh-radius-xs);
    margin-bottom: 20px;
}

.cp-rate-limit__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.15);
    color: var(--sh-warning);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.cp-rate-limit__text {
    font-size: 14px;
    color: #92400e;
    margin: 0;
    line-height: 1.4;
}

.cp-rate-limit__text strong {
    font-weight: 600;
}

/* ─── Empty State ─── */

.cp-empty-state {
    text-align: center;
    padding: 48px 24px;
}

.cp-empty-state__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--sh-primary-bg);
    color: var(--sh-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
}

.cp-empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--sh-text);
    margin: 0 0 8px;
}

.cp-empty-state p {
    font-size: 14px;
    color: var(--sh-text-muted);
    max-width: 440px;
    margin: 0 auto 20px;
    line-height: 1.5;
}

/* ─── Pagination ─── */

.cp-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 24px 0 8px;
}

.cp-pagination__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--sh-radius-xs);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--sh-text-muted);
    text-decoration: none;
    transition: background var(--sh-transition), color var(--sh-transition);
    border: 1px solid transparent;
}

.cp-pagination__item:hover {
    background: var(--sh-card-bg);
    border-color: var(--sh-border);
    color: var(--sh-text);
}

.cp-pagination__item--active {
    background: var(--sh-primary);
    color: #fff;
    font-weight: 600;
    pointer-events: none;
}

.cp-pagination__item--active:hover {
    background: var(--sh-primary);
    color: #fff;
    border-color: transparent;
}

/* ─── Divider ─── */

.cp-divider {
    height: 1px;
    background: var(--sh-border);
    margin: 20px 0;
}

/* ─── Responsive ─── */

@media (max-width: 640px) {
    .cp-container {
        padding: 16px 16px 32px;
    }

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

    .cp-header__title {
        font-size: 18px;
    }

    .cp-feed-card {
        flex-direction: column;
        gap: 12px;
    }

    .cp-feed-card__icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        font-size: 16px;
    }

    .cp-feed-card__action {
        margin-left: 0;
    }

    .cp-day-card {
        padding: 18px;
    }

    .cp-day-card__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .cp-create-form {
        padding: 20px 18px;
    }

    .cp-plan-info {
        padding: 16px 18px;
    }
}
