/* =============================================
   GIRI MAILER — CSS dédié (Mailerlite Clone)
   ============================================= */

/* Layout principal */
.gm-app { display:flex; flex-direction:column; height:100%; background:var(--bg-primary); }
.gm-topbar { display:flex; align-items:center; gap:8px; padding:10px 16px; background:var(--bg-secondary); border-bottom:1px solid var(--border); overflow-x:auto; flex-shrink:0; }
.gm-topbar-btn { display:flex; align-items:center; gap:8px; padding:9px 18px; border:none; border-radius:8px; cursor:pointer; font-size:13px; font-weight:500; background:transparent; color:var(--text-secondary); transition:all .2s; white-space:nowrap; font-family:inherit; }
.gm-topbar-btn:hover { background:var(--bg-tertiary); color:var(--text); }
.gm-topbar-btn.active { background:var(--accent); color:#fff; font-weight:600; }
.gm-content { flex:1; overflow-y:auto; padding:20px; }

/* Cards & grids */
.gm-card { background:var(--bg-card); border:1px solid var(--border); border-radius:12px; padding:20px; }
.gm-card-hover { transition:transform .2s, box-shadow .2s; cursor:pointer; }
.gm-card-hover:hover { transform:translateY(-2px); box-shadow:0 8px 24px rgba(0,0,0,.15); }
.gm-grid { display:grid; gap:16px; }
.gm-grid-2 { grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); }
.gm-grid-3 { grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); }
.gm-grid-4 { grid-template-columns:repeat(auto-fill, minmax(180px, 1fr)); }
.gm-grid-6 { grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)); }

/* Stat cards (dashboard) */
.gm-stat { display:flex; align-items:center; gap:16px; }
.gm-stat-icon { width:48px; height:48px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:20px; flex-shrink:0; }
.gm-stat-value { font-size:28px; font-weight:700; color:var(--text); line-height:1.1; }
.gm-stat-label { font-size:12px; color:var(--text-muted); margin-top:2px; }
.gm-stat-trend { font-size:11px; font-weight:600; margin-top:4px; }
.gm-stat-trend.up { color:#4ade80; }
.gm-stat-trend.down { color:#f87171; }

/* Tables */
.gm-table { width:100%; border-collapse:collapse; }
.gm-table th { text-align:left; padding:12px 14px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--text-muted); border-bottom:2px solid var(--border); }
.gm-table td { padding:12px 14px; border-bottom:1px solid var(--border); font-size:14px; color:var(--text); }
.gm-table tr:hover td { background:var(--bg-secondary); }
.gm-table .gm-email { font-weight:600; color:var(--accent); }

/* Badges */
.gm-badge { display:inline-flex; align-items:center; gap:4px; padding:4px 12px; border-radius:20px; font-size:12px; font-weight:600; }
.gm-badge-draft { background:rgba(148,163,184,.15); color:#94a3b8; }
.gm-badge-active { background:rgba(74,222,128,.15); color:#4ade80; }
.gm-badge-paused { background:rgba(251,191,36,.15); color:#fbbf24; }
.gm-badge-sent { background:rgba(74,222,128,.15); color:#4ade80; }
.gm-badge-sending { background:rgba(96,165,250,.15); color:#60a5fa; }
.gm-badge-scheduled { background:rgba(251,191,36,.15); color:#fbbf24; }
.gm-badge-failed { background:rgba(248,113,113,.15); color:#f87171; }
.gm-badge-subscribed { background:rgba(74,222,128,.15); color:#4ade80; }
.gm-badge-unsubscribed { background:rgba(248,113,113,.15); color:#f87171; }
.gm-badge-popup { background:rgba(168,85,247,.15); color:#a855f7; }
.gm-badge-embed { background:rgba(96,165,250,.15); color:#60a5fa; }
.gm-badge-landing { background:rgba(251,191,36,.15); color:#fbbf24; }
.gm-badge-new { background:rgba(212,164,76,.15); color:#D4A44C; font-size:10px; padding:2px 8px; }

/* Buttons */
.gm-btn { display:inline-flex; align-items:center; gap:8px; padding:10px 20px; border:none; border-radius:8px; cursor:pointer; font-size:13px; font-weight:600; transition:all .2s; font-family:inherit; }
.gm-btn:hover { opacity:.9; transform:translateY(-1px); }
.gm-btn-primary { background:var(--accent); color:#fff; }
.gm-btn-success { background:#4ade80; color:#000; }
.gm-btn-danger { background:#f87171; color:#fff; }
.gm-btn-secondary { background:var(--bg-secondary); color:var(--text); border:1px solid var(--border); }
.gm-btn-ghost { background:none; border:none; color:var(--text-secondary); padding:8px; }
.gm-btn-ghost:hover { color:var(--accent); }
.gm-btn-sm { padding:6px 14px; font-size:12px; }
.gm-btn-icon { width:32px; height:32px; padding:0; display:flex; align-items:center; justify-content:center; border-radius:8px; }

/* Forms & inputs */
.gm-input { width:100%; padding:10px 14px; border:1px solid var(--border); border-radius:8px; background:var(--bg-secondary); color:var(--text); font-size:14px; outline:none; box-sizing:border-box; font-family:inherit; transition:border-color .2s; }
.gm-input:focus { border-color:var(--accent); }
.gm-select { appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 12px center; padding-right:36px; }
.gm-textarea { min-height:120px; resize:vertical; font-family:inherit; }
.gm-label { display:block; font-size:13px; font-weight:600; color:var(--text-secondary); margin-bottom:6px; }
.gm-form-group { margin-bottom:16px; }
.gm-form-row { display:flex; gap:12px; }
.gm-form-row > * { flex:1; }

/* Modals */
.gm-overlay { position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:90000; display:flex; align-items:center; justify-content:center; padding:20px; backdrop-filter:blur(2px); }
.gm-modal { background:var(--bg-card); border-radius:16px; padding:0; max-width:640px; width:90%; max-height:85vh; overflow:hidden; box-shadow:0 24px 60px rgba(0,0,0,.4); display:flex; flex-direction:column; }
.gm-modal-lg { max-width:900px; }
.gm-modal-xl { max-width:1100px; max-height:90vh; }
.gm-modal-header { display:flex; justify-content:space-between; align-items:center; padding:20px 24px; border-bottom:1px solid var(--border); flex-shrink:0; }
.gm-modal-header h2 { margin:0; font-size:18px; color:var(--text); }
.gm-modal-body { padding:24px; overflow-y:auto; flex:1; }
.gm-modal-footer { padding:16px 24px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:10px; flex-shrink:0; }

/* Progress / metrics */
.gm-progress-bar { height:8px; background:var(--bg-tertiary); border-radius:4px; overflow:hidden; }
.gm-progress-fill { height:100%; border-radius:4px; transition:width .5s ease; }
.gm-metric { text-align:center; }
.gm-metric-value { font-size:32px; font-weight:800; color:var(--text); line-height:1; }
.gm-metric-label { font-size:12px; color:var(--text-muted); margin-top:6px; }
.gm-metric-sub { font-size:11px; color:var(--text-secondary); margin-top:2px; }

/* Chart container */
.gm-chart { height:200px; background:var(--bg-secondary); border-radius:8px; padding:16px; position:relative; }
.gm-chart-bar { position:absolute; bottom:16px; background:var(--accent); border-radius:4px 4px 0 0; transition:height .4s ease; min-width:8px; }
.gm-chart-line { position:absolute; bottom:16px; border-bottom:2px solid var(--accent); }

/* Email editor */
.gm-editor { display:flex; height:100%; min-height:500px; }
.gm-editor-sidebar { width:260px; border-right:1px solid var(--border); overflow-y:auto; flex-shrink:0; padding:16px; }
.gm-editor-canvas { flex:1; overflow-y:auto; background:var(--bg-tertiary); padding:20px; display:flex; justify-content:center; }
.gm-editor-email { background:#fff; width:600px; min-height:400px; border-radius:4px; box-shadow:0 2px 12px rgba(0,0,0,.1); }
.gm-editor-block { position:relative; border:2px dashed transparent; padding:0; cursor:move; transition:border-color .2s; }
.gm-editor-block:hover { border-color:var(--accent); }
.gm-editor-block.selected { border-color:var(--accent); border-style:solid; }
.gm-editor-block-toolbar { position:absolute; top:-30px; right:0; display:none; background:var(--bg-card); border:1px solid var(--border); border-radius:6px; padding:4px; gap:2px; z-index:10; }
.gm-editor-block:hover .gm-editor-block-toolbar, .gm-editor-block.selected .gm-editor-block-toolbar { display:flex; }
.gm-editor-drop-zone { border:2px dashed var(--border); border-radius:8px; padding:20px; text-align:center; color:var(--text-muted); font-size:13px; transition:all .2s; min-height:60px; display:flex; align-items:center; justify-content:center; }
.gm-editor-drop-zone.dragover { border-color:var(--accent); background:rgba(212,164,76,.05); }
.gm-editor-panel { width:280px; border-left:1px solid var(--border); overflow-y:auto; flex-shrink:0; padding:16px; }

/* Block types in sidebar */
.gm-block-type { display:flex; align-items:center; gap:10px; padding:10px 12px; border:1px solid var(--border); border-radius:8px; cursor:grab; margin-bottom:8px; transition:all .2s; font-size:13px; color:var(--text); }
.gm-block-type:hover { background:var(--bg-secondary); border-color:var(--accent); }
.gm-block-type i { font-size:16px; color:var(--accent); width:20px; text-align:center; }

/* Automation builder */
.gm-auto-flow { display:flex; flex-direction:column; align-items:center; padding:20px; gap:0; }
.gm-auto-node { background:var(--bg-card); border:2px solid var(--border); border-radius:12px; padding:16px 20px; min-width:280px; max-width:400px; text-align:center; transition:all .2s; }
.gm-auto-node:hover { border-color:var(--accent); box-shadow:0 4px 16px rgba(0,0,0,.1); }
.gm-auto-node-trigger { border-color:var(--accent); background:rgba(212,164,76,.05); }
.gm-auto-node-email { border-left:3px solid #60a5fa; }
.gm-auto-node-delay { border-left:3px solid #fbbf24; }
.gm-auto-node-condition { border-left:3px solid #a855f7; }
.gm-auto-connector { width:2px; height:32px; background:var(--border); }
.gm-auto-add { width:36px; height:36px; border-radius:50%; border:2px dashed var(--border); display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--text-muted); transition:all .2s; background:var(--bg-card); }
.gm-auto-add:hover { border-color:var(--accent); color:var(--accent); }

/* Tags */
.gm-tag { display:inline-flex; align-items:center; gap:4px; padding:3px 10px; border-radius:12px; font-size:11px; font-weight:600; background:rgba(96,165,250,.15); color:#60a5fa; }
.gm-tag-remove { cursor:pointer; opacity:.6; font-size:10px; }
.gm-tag-remove:hover { opacity:1; }
.gm-tag-input-wrap { display:flex; flex-wrap:wrap; gap:6px; padding:8px; border:1px solid var(--border); border-radius:8px; background:var(--bg-secondary); }
.gm-tag-input { border:none; background:none; color:var(--text); outline:none; font-size:13px; min-width:100px; flex:1; }

/* Empty states */
.gm-empty { text-align:center; padding:60px 20px; }
.gm-empty i { font-size:48px; color:var(--text-muted); margin-bottom:16px; }
.gm-empty h3 { color:var(--text); margin-bottom:8px; font-size:18px; }
.gm-empty p { color:var(--text-muted); font-size:14px; margin-bottom:20px; max-width:400px; margin-left:auto; margin-right:auto; }

/* Header with actions */
.gm-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:12px; }
.gm-header h2 { margin:0; font-size:20px; color:var(--text); }
.gm-header-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }

/* Pagination */
.gm-pagination { display:flex; justify-content:center; align-items:center; gap:8px; margin-top:16px; }
.gm-page-info { padding:8px 16px; color:var(--text-secondary); font-size:13px; }

/* Responsive */
@media (max-width:768px) {
  .gm-topbar { gap:4px; padding:8px 12px; }
  .gm-topbar-btn { padding:8px 12px; font-size:12px; }
  .gm-content { padding:12px; }
  .gm-form-row { flex-direction:column; }
  .gm-editor { flex-direction:column; }
  .gm-editor-sidebar { width:100%; border-right:none; border-bottom:1px solid var(--border); max-height:200px; }
  .gm-editor-panel { width:100%; border-left:none; border-top:1px solid var(--border); max-height:250px; }
  .gm-editor-email { width:100%; }
  .gm-grid-2, .gm-grid-3, .gm-grid-4 { grid-template-columns:1fr; }
  .gm-header { flex-direction:column; align-items:flex-start; }
  .gm-stat-value { font-size:22px; }
}

/* Container style - applied via ID not class to avoid conflicts */
#view-giriMailer {
  display: flex !important;
  flex-direction: column;
  height: 100%;
  padding: 0 !important;
  max-width: none !important;
}
#view-giriMailer:not(.active) {
  display: none !important;
}
