/* ThaiPuls Filmtips Admin */
.tpfa-app{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;color:#1a1a1a;max-width:1100px;margin:0 auto;padding:24px 16px}
.tpfa-app *{box-sizing:border-box}
.tpfa-gate{padding:40px;text-align:center;background:#fff8e1;border:1px solid #f5e1a0;border-radius:12px}

/* Header */
.tpfa-header{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:16px;margin:0 0 24px;padding:0 0 16px;border-bottom:2px solid #eee}
.tpfa-header h1{font-size:24px;margin:0;font-weight:700}
.tpfa-tabs{display:flex;gap:8px}
.tpfa-tab{background:#f5f5f5;border:1px solid #e0e0e0;border-radius:8px;padding:10px 16px;cursor:pointer;font-size:14px;font-weight:500;color:#444;transition:all .15s}
.tpfa-tab:hover{background:#eee;color:#1a73e8}
.tpfa-tab.active{background:#1a73e8;color:#fff;border-color:#1a73e8}

/* Views */
.tpfa-view{display:none}
.tpfa-view.active{display:block}

/* List */
.tpfa-list-header{display:flex;gap:12px;margin:0 0 16px}
.tpfa-list-header input,.tpfa-list-header select{padding:10px 14px;border:1px solid #ddd;border-radius:8px;font-size:14px;background:#fff}
#tpfa-search{flex:1}
.tpfa-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:16px}
.tpfa-card{background:#fff;border:1px solid #e5e5e5;border-radius:12px;overflow:hidden;display:flex;flex-direction:column;transition:box-shadow .15s}
.tpfa-card:hover{box-shadow:0 4px 16px rgba(0,0,0,.1)}
.tpfa-card-thumb{aspect-ratio:16/9;background:#f0f0f0 center/cover no-repeat;position:relative}
.tpfa-card-status{position:absolute;top:8px;right:8px;padding:3px 10px;border-radius:99px;font-size:11px;font-weight:600;color:#fff;text-transform:uppercase}
.tpfa-card-status.publish{background:#1f9d55}
.tpfa-card-status.draft{background:#9e9e9e}
.tpfa-card-status.pending{background:#ffa000}
.tpfa-card-type{position:absolute;top:8px;left:8px;padding:3px 10px;border-radius:99px;font-size:11px;font-weight:600;color:#fff;background:rgba(0,0,0,.65)}
.tpfa-card-body{padding:14px;flex:1;display:flex;flex-direction:column;gap:8px}
.tpfa-card-title{font-size:15px;font-weight:600;line-height:1.3;color:#1a1a1a;margin:0}
.tpfa-card-excerpt{font-size:13px;color:#666;line-height:1.4;margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.tpfa-card-meta{font-size:12px;color:#999;margin-top:auto}
.tpfa-card-actions{display:flex;gap:6px;padding:10px 14px;border-top:1px solid #eee;background:#fafafa}
.tpfa-card-actions .tpfa-btn{flex:1;padding:7px 8px;font-size:12px;border-radius:6px}
.tpfa-loading{padding:40px;text-align:center;color:#999;grid-column:1/-1}

/* Form */
.tpfa-form{background:#fff;border:1px solid #e5e5e5;border-radius:12px;padding:24px;display:flex;flex-direction:column;gap:18px}
.tpfa-fs{border:1px solid #eee;border-radius:8px;padding:18px;margin:0;background:#fafafa}
.tpfa-fs legend{font-weight:600;font-size:14px;color:#1a73e8;padding:0 8px;background:#fff;border:1px solid #eee;border-radius:6px}
.tpfa-fs-scrape{background:#e8f0fe;border-color:#cce0ff}
.tpfa-row{margin:0 0 14px}
.tpfa-row:last-child{margin:0}
.tpfa-row-2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.tpfa-row-3{display:grid;grid-template-columns:2fr 1fr 1fr;gap:14px}
.tpfa-row-inline{display:flex;gap:8px}
.tpfa-row-inline input{flex:1}
.tpfa-row label{display:block;font-size:13px;font-weight:600;color:#444;margin:0 0 6px}
.tpfa-row input[type=text],.tpfa-row input[type=url],.tpfa-row input[type=search],.tpfa-row input[type=email],.tpfa-row select,.tpfa-row textarea{width:100%;padding:9px 12px;border:1px solid #ddd;border-radius:7px;font-size:14px;background:#fff;font-family:inherit;color:#1a1a1a}
.tpfa-row textarea{resize:vertical;min-height:60px}
.tpfa-row input:focus,.tpfa-row select:focus,.tpfa-row textarea:focus{outline:none;border-color:#1a73e8;box-shadow:0 0 0 3px rgba(26,115,232,.15)}
.tpfa-hint{font-weight:400;color:#999;font-size:11px;margin-left:4px}
.tpfa-required{color:#cc0000}

/* Buttons */
.tpfa-btn{background:#fff;color:#1a73e8;border:1px solid #1a73e8;border-radius:8px;padding:10px 20px;font-size:14px;font-weight:600;cursor:pointer;transition:all .15s;text-decoration:none;display:inline-block;line-height:1.2;font-family:inherit}
.tpfa-btn:hover{background:#1a73e8;color:#fff}
.tpfa-btn-primary{background:#1a73e8;color:#fff}
.tpfa-btn-primary:hover{background:#1666d0}
.tpfa-btn-secondary{background:#f5f5f5;color:#444;border-color:#ddd}
.tpfa-btn-secondary:hover{background:#eee;color:#1a73e8;border-color:#1a73e8}
.tpfa-btn-cancel{background:transparent;color:#999;border-color:#ccc}
.tpfa-btn-cancel:hover{background:#f5f5f5;color:#444}
.tpfa-btn-danger{color:#cc0000;border-color:#cc0000}
.tpfa-btn-danger:hover{background:#cc0000;color:#fff}

.tpfa-actions{display:flex;gap:10px;justify-content:flex-end;margin:8px 0 0;padding:16px 0 0;border-top:1px solid #eee}

/* Status */
.tpfa-status{margin:8px 0;padding:0;font-size:13px}
.tpfa-status.ok{color:#1f9d55;background:#e8f5e9;padding:10px 14px;border-radius:7px}
.tpfa-status.err{color:#cc0000;background:#ffebee;padding:10px 14px;border-radius:7px}
.tpfa-status.loading{color:#1a73e8}

/* Preview */
.tpfa-preview{display:flex;gap:14px;flex-wrap:wrap}
.tpfa-preview img{max-height:160px;border-radius:8px;border:1px solid #eee}

/* Modal */
.tpfa-modal{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:99999;display:flex;align-items:center;justify-content:center;padding:20px}
.tpfa-modal[hidden]{display:none}
.tpfa-modal-inner{background:#fff;border-radius:12px;padding:28px;max-width:480px;width:100%;position:relative;box-shadow:0 12px 40px rgba(0,0,0,.3)}
.tpfa-modal-close{position:absolute;top:10px;right:14px;background:none;border:0;font-size:28px;cursor:pointer;color:#999;line-height:1;padding:4px}
.tpfa-modal-close:hover{color:#1a1a1a}
.tpfa-modal h3{margin:0 0 8px;font-size:18px}
.tpfa-share-title{color:#666;margin:0 0 18px;font-size:14px}
.tpfa-share-buttons{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 0 14px}
.tpfa-share-btn{padding:12px 14px;border-radius:8px;font-size:14px;font-weight:600;text-align:center;text-decoration:none;border:0;cursor:pointer;font-family:inherit;color:#fff;transition:filter .15s}
.tpfa-share-btn:hover{filter:brightness(1.1);color:#fff}
.tpfa-share-btn.fb{background:#1877f2}
.tpfa-share-btn.x{background:#000}
.tpfa-share-btn.wa{background:#25d366}
.tpfa-share-btn.threads{background:#1a1a1a}
.tpfa-share-btn.mail{background:#ea4335}
.tpfa-share-btn.copy{background:#666}
.tpfa-share-link input{width:100%;padding:10px 12px;border:1px solid #ddd;border-radius:7px;font-size:13px;font-family:monospace;background:#fafafa}

/* User bar */
.tpfa-user-bar{background:#e8f0fe;border:1px solid #cce0ff;border-radius:8px;padding:10px 14px;margin:0 0 18px;font-size:13px;color:#444;display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.tpfa-user-bar strong{color:#1a73e8;font-weight:700}
.tpfa-user-bar em{color:#1a1a1a;font-style:normal;font-weight:600}
.tpfa-user-role{color:#999;font-size:12px}
.tpfa-user-bar a{color:#1a73e8;text-decoration:none;font-weight:500}
.tpfa-user-bar a:hover{text-decoration:underline}

/* TMDB search autocomplete */
.tpfa-search-wrap{position:relative}
.tpfa-search-results{position:absolute;top:100%;left:0;right:0;background:#fff;border:1px solid #ddd;border-top:0;border-radius:0 0 8px 8px;max-height:420px;overflow-y:auto;z-index:100;box-shadow:0 8px 24px rgba(0,0,0,.12)}
.tpfa-search-results[hidden]{display:none}
.tpfa-search-loading{padding:18px;text-align:center;color:#999;font-size:13px}
.tpfa-search-item{display:flex;gap:12px;padding:10px 12px;cursor:pointer;border-bottom:1px solid #f0f0f0;align-items:center}
.tpfa-search-item:last-child{border-bottom:0}
.tpfa-search-item:hover{background:#f5f9ff}
.tpfa-search-thumb{flex:0 0 46px;width:46px;height:69px;background:#eee center/cover no-repeat;border-radius:5px}
.tpfa-search-info{flex:1;min-width:0}
.tpfa-search-title{font-weight:600;font-size:14px;color:#1a1a1a;line-height:1.3}
.tpfa-search-meta{font-size:12px;color:#777;margin-top:2px}
.tpfa-advanced{margin-top:10px;font-size:13px}
.tpfa-advanced summary{cursor:pointer;color:#666;padding:6px 0;user-select:none}
.tpfa-advanced summary:hover{color:#1a73e8}
.tpfa-share-section{font-size:13px;font-weight:600;text-transform:uppercase;color:#888;margin:18px 0 10px;letter-spacing:.5px}
.tpfa-share-section:first-of-type{margin-top:8px}
.tpfa-share-btn.fb-group{background:#1877f2;opacity:.85}
.tpfa-share-btn.fb-group:hover{opacity:1}
.tpfa-share-result{margin:10px 0;font-size:13px;min-height:0}
.tpfa-share-result.ok{color:#1f9d55;background:#e8f5e9;padding:10px 14px;border-radius:7px}
.tpfa-share-result.err{color:#cc0000;background:#ffebee;padding:10px 14px;border-radius:7px}
.tpfa-share-result a{color:inherit;text-decoration:underline;font-weight:600}

@media(max-width:640px){
  .tpfa-row-2,.tpfa-row-3{grid-template-columns:1fr}
  .tpfa-actions{flex-direction:column}
  .tpfa-actions .tpfa-btn{width:100%}
  .tpfa-share-buttons{grid-template-columns:1fr}
}
