/* Traffic Tap — user-dashboard.css */

/* -------------------------------------------------------------------------
   Layout
------------------------------------------------------------------------- */
.tt-dashboard {
    max-width: 860px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, sans-serif;
    color: #1a1a1a;
    font-size: 15px;
    line-height: 1.5;
}

/* -------------------------------------------------------------------------
   Panels
------------------------------------------------------------------------- */
.tt-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 28px;
    margin-bottom: 24px;
}

.tt-panel-title {
    margin: 0 0 20px;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #111827;
}

/* -------------------------------------------------------------------------
   Generator form
------------------------------------------------------------------------- */
.tt-form-row {
    display: flex;
    gap: 10px;
}

.tt-keyword-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 0.9375rem;
    color: #111827;
    background: #f9fafb;
    outline: none;
    transition: border-color 0.15s;
}

.tt-keyword-input:focus {
    border-color: #2563eb;
    background: #fff;
}

.tt-keyword-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* -------------------------------------------------------------------------
   Buttons
------------------------------------------------------------------------- */
.tt-btn {
    padding: 10px 22px;
    border: none;
    border-radius: 7px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    white-space: nowrap;
}

.tt-btn--primary {
    background: #2563eb;
    color: #ffffff;
}

.tt-btn--primary:hover:not(:disabled) {
    background: #1d4ed8;
}

.tt-btn--ghost {
    background: transparent;
    color: #2563eb;
    border: 1px solid #2563eb;
    padding: 6px 16px;
    font-size: 0.875rem;
}

.tt-btn--ghost:hover {
    background: #eff6ff;
}

.tt-btn--danger {
    background: #dc2626;
    color: #fff;
    padding: 7px 16px;
    font-size: 0.875rem;
}

.tt-btn--danger:hover:not(:disabled) {
    background: #b91c1c;
}

.tt-btn--publish {
    background: #059669;
    color: #fff;
    padding: 9px 20px;
    font-size: 0.9rem;
}

.tt-btn--publish:hover:not(:disabled) {
    background: #047857;
}

.tt-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* -------------------------------------------------------------------------
   Notices
------------------------------------------------------------------------- */
.tt-notice {
    padding: 11px 16px;
    border-radius: 7px;
    margin-bottom: 18px;
    font-size: 0.875rem;
}

.tt-notice--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.tt-notice--error a {
    color: #991b1b;
    font-weight: 600;
}

/* -------------------------------------------------------------------------
   Spinner
------------------------------------------------------------------------- */
.tt-spinner-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 0;
    gap: 16px;
}

.tt-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: tt-spin 0.75s linear infinite;
}

@keyframes tt-spin {
    to { transform: rotate(360deg); }
}

.tt-spinner-msg {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
}

/* -------------------------------------------------------------------------
   Output — hero image
------------------------------------------------------------------------- */
.tt-hero-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 28px;
}

/* -------------------------------------------------------------------------
   Output — article content
------------------------------------------------------------------------- */
.tt-article-content {
    line-height: 1.75;
    color: #1f2937;
}

.tt-article-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 1.25rem;
    color: #111827;
    line-height: 1.25;
}

.tt-article-content h2 {
    font-size: 1.375rem;
    font-weight: 700;
    margin: 2rem 0 0.75rem;
    color: #111827;
    line-height: 1.3;
}

.tt-article-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
    color: #1f2937;
}

.tt-article-content p {
    margin: 0 0 1.1rem;
}

.tt-article-content p:last-child {
    margin-bottom: 0;
}

/* -------------------------------------------------------------------------
   History header
------------------------------------------------------------------------- */
.tt-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.tt-history-count {
    font-weight: 400;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* -------------------------------------------------------------------------
   Bulk select bar
------------------------------------------------------------------------- */
.tt-bulk-bar {
    padding: 8px 0 12px;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 4px;
}

.tt-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #6b7280;
    cursor: pointer;
    user-select: none;
}

/* -------------------------------------------------------------------------
   History list
------------------------------------------------------------------------- */
.tt-history {
    display: flex;
    flex-direction: column;
}

.tt-history-item {
    border-bottom: 1px solid #f3f4f6;
    padding: 14px 0;
}

.tt-history-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.tt-history-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tt-checkbox-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.tt-checkbox-wrap input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.tt-history-thumb {
    width: 72px;
    height: 40px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
}

.tt-history-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tt-history-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tt-history-date {
    font-size: 0.8125rem;
    color: #9ca3af;
}

.tt-history-content {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

/* -------------------------------------------------------------------------
   Pagination
------------------------------------------------------------------------- */
.tt-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

.tt-page-btn {
    display: inline-block;
    padding: 7px 16px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: background 0.15s;
}

.tt-page-btn:hover {
    background: #f9fafb;
    color: #111827;
}

.tt-page-btn--disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: default;
}

.tt-page-info {
    font-size: 0.875rem;
    color: #6b7280;
}
