/* TNM SEO Gallery — Client Portal Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --brand: #1B5896;
    --brand-hover: #154a7a;
    --brand-light: #e8f0f9;
    --success: #00a32a;
    --danger: #d63638;
    --border: #dcdcde;
    --surface: #f6f7f7;
    --text: #1d2327;
    --text-muted: #646970;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,.1);
}

body.tnmp-portal-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f0f2f5;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.tnmp-portal { min-height: 100vh; display: flex; flex-direction: column; }

/* Header */
.tnmp-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.tnmp-header-inner { max-width: 1100px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.tnmp-header-brand { display: flex; align-items: center; gap: 10px; }
.tnmp-header-name { font-weight: 600; font-size: 16px; color: var(--text); }
.tnmp-back-link { color: var(--text-muted); display: flex; align-items: center; text-decoration: none; margin-right: 4px; }
.tnmp-back-link:hover { color: var(--brand); }
.tnmp-header-actions { display: flex; gap: 8px; }

/* Main */
.tnmp-main { flex: 1; padding: 32px 20px; }
.tnmp-container { max-width: 1100px; margin: 0 auto; }
.tnmp-container-narrow { max-width: 720px; }

/* Footer */
.tnmp-footer { background: #fff; border-top: 1px solid var(--border); padding: 16px 20px; text-align: center; font-size: 13px; color: var(--text-muted); }
.tnmp-footer a { color: var(--brand); text-decoration: none; }

/* Buttons */
.tnmp-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: var(--radius); font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; border: 1px solid transparent; transition: all 0.15s; font-family: inherit; white-space: nowrap; }
.tnmp-btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.tnmp-btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.tnmp-btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.tnmp-btn-secondary:hover { background: var(--surface); }
.tnmp-btn-ghost { background: transparent; color: var(--text-muted); }
.tnmp-btn-ghost:hover { background: var(--surface); color: var(--text); }
.tnmp-btn-danger { background: #fce8e8; color: var(--danger); border-color: #f5c6c6; }
.tnmp-btn-danger:hover { background: #f9d5d5; }
.tnmp-btn-ai { background: linear-gradient(135deg, #1B5896, #2d7dd2); color: #fff; border: none; width: 100%; justify-content: center; padding: 14px; font-size: 15px; margin-top: 16px; }
.tnmp-btn-ai:hover { opacity: .9; color: #fff; }
.tnmp-btn-live { background: #d7f0dc; color: var(--success); border-color: #b8e0c0; }
.tnmp-btn-draft { background: var(--surface); color: var(--text-muted); border-color: var(--border); }
.tnmp-btn-full { width: 100%; justify-content: center; }
.tnmp-btn-sm { padding: 6px 12px; font-size: 12px; }

/* Cards */
.tnmp-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.tnmp-card-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.tnmp-card-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.tnmp-ai-card { border-color: #c7d9ef; background: linear-gradient(to bottom, #f8fbff, #fff); }
.tnmp-ai-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }

/* Stats */
.tnmp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.tnmp-stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow); }
.tnmp-stat-value { font-size: 36px; font-weight: 700; font-family: monospace; color: var(--brand); }
.tnmp-stat-value.tnmp-green { color: var(--success); }
.tnmp-stat-value.tnmp-grey { color: var(--text-muted); }
.tnmp-stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }

/* Section header */
.tnmp-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.tnmp-section-header h2 { font-size: 18px; font-weight: 600; }

/* Project grid */
.tnmp-project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.tnmp-project-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tnmp-card-thumb { aspect-ratio: 16/10; background: var(--surface); position: relative; overflow: hidden; }
.tnmp-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tnmp-card-no-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 13px; gap: 6px; }
.tnmp-card-status { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 4px; }
.tnmp-card-status.live { background: #d7f0dc; color: var(--success); }
.tnmp-card-status.draft { background: rgba(0,0,0,.5); color: #fff; }
.tnmp-card-body { padding: 14px; }
.tnmp-card-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.tnmp-card-title a { color: var(--text); text-decoration: none; }
.tnmp-card-title a:hover { color: var(--brand); }
.tnmp-card-trade { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.tnmp-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Forms */
.tnmp-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.tnmp-field label { font-size: 13px; font-weight: 600; color: var(--text); }
.tnmp-fields-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tnmp-input, .tnmp-select, .tnmp-textarea { border: 1px solid var(--border); border-radius: 6px; padding: 10px 14px; font-size: 14px; font-family: inherit; color: var(--text); width: 100%; transition: border .15s; }
.tnmp-input:focus, .tnmp-select:focus, .tnmp-textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(27,88,150,.1); }
.tnmp-textarea { resize: vertical; min-height: 120px; }
.tnmp-char-count { font-size: 11px; color: var(--text-muted); font-weight: 400; float: right; }
.tnmp-char-count.over { color: var(--danger); }
.req { color: var(--danger); }

/* Voice input */
.tnmp-voice-field { display: flex; gap: 8px; }
.tnmp-voice-field .tnmp-input { flex: 1; }
.tnmp-voice-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 0 12px; font-size: 18px; cursor: pointer; flex-shrink: 0; transition: all .15s; }
.tnmp-voice-btn:hover { background: var(--brand-light); border-color: var(--brand); }
.tnmp-voice-btn.listening { background: #fce8e8; border-color: var(--danger); animation: tnmp-pulse 1s infinite; }
@keyframes tnmp-pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }
.tnmp-voice-playback { background: var(--brand-light); border: 1px solid #c7d9ef; border-radius: 8px; padding: 14px; margin: 12px 0; }
.tnmp-playback-text { font-size: 14px; color: var(--brand); margin-bottom: 10px; font-style: italic; }
.tnmp-playback-actions { display: flex; gap: 8px; }

/* Toggle */
.tnmp-toggle-label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.tnmp-toggle-label input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--brand); }
.tnmp-toggle-text { font-size: 14px; }

/* Media */
.tnmp-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tnmp-media-item { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--surface); }
.tnmp-media-item img { width: 100%; height: 100%; object-fit: cover; }
.tnmp-media-video { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--text-muted); }
.tnmp-media-delete { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.7); color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; font-size: 11px; cursor: pointer; display: none; align-items: center; justify-content: center; }
.tnmp-media-item:hover .tnmp-media-delete { display: flex; }
.tnmp-media-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tnmp-video-add { display: flex; gap: 8px; flex: 1; min-width: 200px; }
.tnmp-video-add .tnmp-input { flex: 1; }

/* Form actions */
.tnmp-form-actions { display: flex; gap: 10px; padding-top: 8px; margin-bottom: 40px; }

/* Notices */
.tnmp-notice { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 20px; }
.tnmp-notice-success { background: #d7f0dc; color: #00592a; border: 1px solid #b8e0c0; }
.tnmp-notice-error { background: #fce8e8; color: #b32d2e; border: 1px solid #f5c6c6; }

/* Empty state */
.tnmp-empty-state { text-align: center; padding: 60px 20px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.tnmp-empty-icon { font-size: 48px; margin-bottom: 16px; }
.tnmp-empty-state h2 { font-size: 22px; margin-bottom: 10px; }
.tnmp-empty-state p { color: var(--text-muted); margin-bottom: 24px; max-width: 400px; margin-left: auto; margin-right: auto; }

/* Login */
.tnmp-login-wrap { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; background: #f0f2f5; }
.tnmp-login-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 40px; width: 100%; max-width: 400px; box-shadow: 0 4px 24px rgba(0,0,0,.08); }
.tnmp-login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.tnmp-login-title { font-size: 20px; font-weight: 700; }
.tnmp-login-sub { font-size: 12px; color: var(--text-muted); }
.tnmp-remember { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; }
.tnmp-login-help { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 20px; }
.tnmp-login-help a { color: var(--brand); text-decoration: none; }

@media (max-width: 600px) {
    .tnmp-stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .tnmp-stat { padding: 14px 10px; }
    .tnmp-stat-value { font-size: 28px; }
    .tnmp-fields-row { grid-template-columns: 1fr; }
    .tnmp-project-grid { grid-template-columns: 1fr 1fr; }
    .tnmp-card { padding: 16px; }
    .tnmp-header-name { font-size: 14px; }
}
@media (max-width: 400px) {
    .tnmp-project-grid { grid-template-columns: 1fr; }
}
