/* ============================================================
   COMPONENTS.CSS - RAMIXOSS Unified Design System
   ============================================================ */

/* ============ BUTTONS ============ */
.btn {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px 28px; border-radius: 50px; font-weight: 700; font-size: 0.95rem;
    font-family: var(--font); cursor: pointer; transition: var(--transition);
    border: none; outline: none; user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible {
    box-shadow: 0 0 0 3px var(--primary-light);
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; box-shadow: var(--shadow-primary);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(108,60,225,0.45); }
.btn-primary:active { transform: translateY(-1px); }
.btn-success {
    background: linear-gradient(135deg, var(--success), #27AE60);
    color: #fff; box-shadow: var(--shadow-success);
}
.btn-success:hover { transform: translateY(-2px); }
.btn-danger {
    background: linear-gradient(135deg, var(--danger), #C0392B);
    color: #fff; box-shadow: var(--shadow-danger);
}
.btn-danger:hover { transform: translateY(-2px); }
.btn-warning {
    background: linear-gradient(135deg, var(--warning), #D4AC0D);
    color: #1a1a1a; box-shadow: var(--shadow-warning);
}
.btn-warning:hover { transform: translateY(-2px); }
.btn-outline {
    background: transparent; color: var(--text);
    border: 2px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.btn-outline-primary {
    background: transparent; color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary); color: #fff; transform: translateY(-2px);
}
.btn-ghost {
    background: transparent; color: var(--text-secondary); border: none; padding: 10px 18px;
}
.btn-ghost:hover { background: var(--primary-light); color: var(--primary); }
.btn-sm { padding: 8px 18px; font-size: 0.82rem; border-radius: 50px; }
.btn-lg { padding: 16px 40px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn:disabled, .btn[disabled] {
    opacity: 0.55; cursor: not-allowed !important; transform: none !important;
    box-shadow: none !important;
}
.btn-loading::after {
    content: ""; display: inline-block; width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%; animation: btn-spin 0.8s linear infinite;
    margin-inline-start: 10px;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ============ ICON BUTTON ============ */
.icon-btn {
    width: 42px; height: 42px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-card); color: var(--text-secondary);
    border: 1px solid var(--border); cursor: pointer;
    transition: var(--transition); font-size: 1rem;
}
.icon-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.icon-btn:focus-visible { box-shadow: 0 0 0 3px var(--primary-light); }

/* ============ CARD ============ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: var(--transition);
    position: relative; overflow: hidden;
}
.card:hover { border-color: rgba(108,60,225,0.35); box-shadow: var(--shadow); }
.card-hoverable:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 1.25rem; font-weight: 800; }
.card-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }
.card-body { position: relative; }
.card-footer {
    margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.card-gradient::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

/* ============ STAT CARD / DATA CARD ============ */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    transition: var(--transition);
}
.stat-card:hover { border-color: rgba(108,60,225,0.35); transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card-icon {
    width: 56px; height: 56px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-light); color: var(--primary); font-size: 1.5rem;
    flex-shrink: 0;
}
.stat-card-icon.success { background: rgba(46,204,113,0.15); color: var(--success); }
.stat-card-icon.danger { background: rgba(231,76,60,0.15); color: var(--danger); }
.stat-card-icon.warning { background: rgba(241,196,15,0.15); color: var(--warning); }
.stat-card-icon.accent { background: rgba(0,212,255,0.15); color: var(--accent); }
.stat-card-value { font-size: 2rem; font-weight: 900; margin: 0; }
.stat-card-label { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }
.stat-card-trend {
    margin-top: 8px; font-size: 0.82rem; font-weight: 700;
    display: inline-flex; align-items: center; gap: 4px;
}
.stat-card-trend.up { color: var(--success); }
.stat-card-trend.down { color: var(--danger); }

/* ============ NEWS CARD / EVENT CARD / USER CARD ============ */
.news-card, .event-card, .user-card, .tool-card, .project-card, .service-card, .job-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: var(--transition); display: flex; flex-direction: column;
}
.news-card:hover, .event-card:hover, .tool-card:hover, .project-card:hover, .service-card:hover, .job-card:hover {
    border-color: rgba(108,60,225,0.35); transform: translateY(-4px); box-shadow: var(--shadow-hover);
}
.news-card-cover, .event-card-cover, .project-card-cover, .tool-card-icon-wrap, .service-card-icon-wrap {
    height: 200px; background: linear-gradient(135deg, var(--primary-light), var(--bg-secondary));
    display: flex; align-items: center; justify-content: center;
    font-size: 3.5rem; color: var(--primary); position: relative; overflow: hidden;
}
.event-card-date {
    position: absolute; top: 14px; inset-inline-start: 14px;
    background: var(--primary); color: #fff; border-radius: 12px;
    padding: 8px 12px; text-align: center;
    box-shadow: var(--shadow-sm);
}
.event-card-date-day { font-size: 1.3rem; font-weight: 900; line-height: 1; }
.event-card-date-month { font-size: 0.7rem; opacity: 0.9; font-weight: 600; }
.news-card-body, .event-card-body, .user-card-body, .tool-card-body, .project-card-body, .service-card-body, .job-card-body {
    padding: 22px; display: flex; flex-direction: column; gap: 12px; flex: 1;
}
.news-card-meta, .event-card-meta, .job-card-meta {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    font-size: 0.82rem; color: var(--text-muted);
}
.news-card-title, .event-card-title, .tool-card-title, .project-card-title, .service-card-title, .job-card-title {
    font-size: 1.2rem; font-weight: 800; line-height: 1.4;
}
.news-card-desc, .event-card-desc, .tool-card-desc, .project-card-desc, .service-card-desc, .job-card-desc {
    color: var(--text-secondary); font-size: 0.92rem; line-height: 1.7;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card-footer, .event-card-footer, .tool-card-footer, .project-card-footer, .job-card-footer {
    margin-top: auto; display: flex; align-items: center; justify-content: space-between;
    padding-top: 14px; border-top: 1px solid var(--border);
}
.user-card { flex-direction: row; align-items: center; gap: 18px; padding: 20px; }
.user-card-avatar {
    width: 68px; height: 68px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; font-weight: 800; flex-shrink: 0; border: 3px solid var(--border);
}
.user-card-name { font-weight: 800; font-size: 1.05rem; }
.user-card-username { color: var(--text-muted); font-size: 0.88rem; margin-top: 2px; }
.user-card-meta { color: var(--text-secondary); font-size: 0.88rem; margin-top: 6px; }

/* ============ BADGES ============ */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 50px; font-size: 0.78rem; font-weight: 700;
    background: var(--bg-secondary); color: var(--text-secondary);
    border: 1px solid var(--border);
}
.badge-primary { background: var(--primary-light); color: var(--primary); border-color: transparent; }
.badge-success { background: rgba(46,204,113,0.15); color: var(--success); border-color: transparent; }
.badge-danger { background: rgba(231,76,60,0.15); color: var(--danger); border-color: transparent; }
.badge-warning { background: rgba(241,196,15,0.15); color: var(--warning); border-color: transparent; }
.badge-accent { background: rgba(0,212,255,0.15); color: var(--accent); border-color: transparent; }
.badge-gold {
    background: linear-gradient(135deg, rgba(241,196,15,0.2), rgba(243, 156, 18, 0.2));
    color: var(--gold); border-color: transparent;
}
.status-draft { background: rgba(108,60,225,0.15); color: var(--primary); border-color: transparent; }
.status-scheduled { background: rgba(241,196,15,0.15); color: var(--warning); border-color: transparent; }
.status-published { background: rgba(46,204,113,0.15); color: var(--success); border-color: transparent; }
.status-archived { background: rgba(128,128,128,0.15); color: #95a5a6; border-color: transparent; }
.status-upcoming { background: rgba(0,212,255,0.15); color: var(--accent); border-color: transparent; }
.status-live {
    background: rgba(231,76,60,0.15); color: var(--danger); border-color: transparent;
    position: relative; padding-inline-start: 22px;
}
.status-live::before {
    content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%;
    background: var(--danger); inset-inline-start: 9px;
    animation: live-pulse 1.5s ease-in-out infinite;
}
@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}
.status-completed { background: rgba(128,128,128,0.15); color: #95a5a6; border-color: transparent; }
.status-pending { background: rgba(241,196,15,0.15); color: var(--warning); border-color: transparent; }
.status-paid { background: rgba(46,204,113,0.15); color: var(--success); border-color: transparent; }
.status-processing { background: rgba(0,212,255,0.15); color: var(--accent); border-color: transparent; }
.status-failed { background: rgba(231,76,60,0.15); color: var(--danger); border-color: transparent; }
.status-cancelled { background: rgba(128,128,128,0.15); color: #95a5a6; border-color: transparent; }
.status-refunded { background: rgba(108,60,225,0.15); color: var(--primary); border-color: transparent; }
.status-sold_out { background: rgba(231,76,60,0.15); color: var(--danger); border-color: transparent; }
.status-registration_open { background: rgba(46,204,113,0.15); color: var(--success); border-color: transparent; }

/* ============ AVATAR ============ */
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; font-weight: 800; font-size: 0.95rem;
    border: 2px solid var(--border); overflow: hidden; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.8rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 2rem; }
.avatar-group { display: inline-flex; }
.avatar-group .avatar { border-color: var(--bg); margin-inline-start: -10px; }
.avatar-group .avatar:first-child { margin-inline-start: 0; }

/* ============ BADGE VERIFIED ============ */
.verified-badge {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--accent); font-size: 1rem;
}
.verified-badge-lg { font-size: 1.25rem; }

/* ============ TABS ============ */
.tabs {
    display: flex; gap: 4px; flex-wrap: wrap;
    padding: 4px; background: var(--bg-secondary); border-radius: 50px;
    border: 1px solid var(--border);
}
.tab {
    padding: 10px 22px; border-radius: 50px; border: none; cursor: pointer;
    background: transparent; color: var(--text-secondary);
    font-family: var(--font); font-size: 0.9rem; font-weight: 600;
    transition: var(--transition);
}
.tab:hover { color: var(--primary); }
.tab.active {
    background: var(--primary); color: #fff;
    box-shadow: var(--shadow-sm);
}
.tabs-vertical { flex-direction: column; border-radius: var(--radius); }
.tabs-vertical .tab { text-align: start; border-radius: var(--radius-sm); padding: 14px 18px; }

/* ============ TABLE ============ */
.data-table-wrap {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden;
}
.data-table {
    width: 100%; border-collapse: collapse; font-size: 0.92rem;
}
.data-table thead { background: var(--bg-secondary); }
.data-table th, .data-table td {
    padding: 14px 18px; text-align: start; border-bottom: 1px solid var(--border);
}
.data-table th {
    font-weight: 800; color: var(--text-secondary);
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px;
}
.data-table tbody tr { transition: var(--transition); }
.data-table tbody tr:hover { background: var(--primary-light); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table-actions { display: flex; align-items: center; gap: 6px; }
.data-table-empty {
    padding: 60px 20px; text-align: center; color: var(--text-muted);
}

/* ============ PAGINATION ============ */
.pagination {
    display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 32px;
}
.page-btn {
    min-width: 40px; height: 40px; padding: 0 14px;
    border: 1px solid var(--border); background: var(--bg-card);
    color: var(--text-secondary); border-radius: 10px;
    font-family: var(--font); font-weight: 700; cursor: pointer;
    transition: var(--transition);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ============ FORM FIELDS ============ */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block; margin-bottom: 8px;
    font-weight: 700; font-size: 0.9rem; color: var(--text-secondary);
}
.form-label-required::after {
    content: " *"; color: var(--danger);
}
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 13px 18px;
    background: var(--bg-secondary); border: 2px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    font-family: var(--font); font-size: 0.95rem;
    transition: var(--transition); outline: none;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
    background: var(--bg-card);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-select { appearance: none; padding-inline-end: 42px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position: calc(100% - 20px) 50%, calc(100% - 12px) 50%;
    background-size: 8px 8px, 8px 8px; background-repeat: no-repeat;
}
.form-input.valid, .form-textarea.valid { border-color: var(--success); }
.form-input.invalid, .form-textarea.invalid { border-color: var(--danger); }
.form-hint { font-size: 0.82rem; color: var(--text-muted); margin-top: 6px; }
.form-error { font-size: 0.82rem; color: var(--danger); margin-top: 6px; font-weight: 600; }
.form-success { font-size: 0.82rem; color: var(--success); margin-top: 6px; font-weight: 600; }
.form-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
}
.form-actions {
    display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap;
    gap: 12px; margin-top: 28px;
}
.form-switch {
    display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none;
}
.form-switch input[type="checkbox"] { display: none; }
.form-switch-slider {
    width: 46px; height: 26px; background: var(--bg-secondary); border: 2px solid var(--border);
    border-radius: 50px; position: relative; transition: var(--transition);
}
.form-switch-slider::after {
    content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
    background: var(--text-muted); top: 2px; inset-inline-start: 2px; transition: var(--transition);
}
.form-switch input:checked + .form-switch-slider { background: var(--primary); border-color: var(--primary); }
.form-switch input:checked + .form-switch-slider::after {
    inset-inline-start: 22px; background: #fff;
}
.form-file {
    position: relative; border: 2px dashed var(--border);
    border-radius: var(--radius-sm); padding: 32px; text-align: center;
    transition: var(--transition); cursor: pointer; background: var(--bg-secondary);
}
.form-file:hover, .form-file.dragover { border-color: var(--primary); background: var(--primary-light); }
.form-file input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.form-file-icon { font-size: 2.5rem; color: var(--primary); margin-bottom: 12px; }
.form-file-hint { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

/* ============ SEARCH INPUT ============ */
.search-input-wrap {
    position: relative;
}
.search-input-wrap i {
    position: absolute; top: 50%; inset-inline-start: 16px; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none;
}
.search-input {
    width: 100%; padding: 12px 18px 12px 44px;
    padding-inline-start: 44px;
    background: var(--bg-secondary); border: 2px solid var(--border);
    border-radius: 50px; color: var(--text);
    font-family: var(--font); font-size: 0.92rem; transition: var(--transition);
    outline: none;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

/* ============ MODAL ============ */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    display: none; align-items: center; justify-content: center;
    z-index: 3000; padding: 20px;
    opacity: 0; transition: opacity 0.25s ease;
}
.modal-overlay.open { display: flex; opacity: 1; }
.modal-box {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-lg); width: 100%; max-width: 600px;
    max-height: 90vh; overflow: hidden;
    display: flex; flex-direction: column;
    transform: translateY(20px) scale(0.96);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 80px rgba(0,0,0,0.4);
}
.modal-overlay.open .modal-box { transform: translateY(0) scale(1); }
.modal-lg { max-width: 850px; }
.modal-sm { max-width: 420px; }
.modal-header {
    padding: 22px 26px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.modal-title { font-size: 1.2rem; font-weight: 900; }
.modal-close {
    width: 40px; height: 40px; border: none; background: var(--bg-secondary);
    border-radius: 50%; cursor: pointer; color: var(--text-secondary);
    transition: var(--transition); font-size: 1.1rem;
}
.modal-close:hover { background: rgba(231,76,60,0.15); color: var(--danger); }
.modal-body { padding: 26px; overflow-y: auto; }
.modal-footer {
    padding: 18px 26px; border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px;
}

/* ============ CONFIRMATION DIALOG ============ */
.confirm-icon {
    width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; background: rgba(231,76,60,0.15); color: var(--danger);
}
.confirm-icon.success { background: rgba(46,204,113,0.15); color: var(--success); }
.confirm-icon.warning { background: rgba(241,196,15,0.15); color: var(--warning); }
.confirm-title { font-size: 1.3rem; font-weight: 900; text-align: center; }
.confirm-message { color: var(--text-secondary); text-align: center; margin-top: 10px; line-height: 1.7; }

/* ============ DRAWER (SIDEBAR MENU) ============ */
.drawer-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.55);
    backdrop-filter: blur(3px); z-index: 2500;
    display: none; opacity: 0; transition: opacity 0.25s ease;
}
.drawer-overlay.open { display: block; opacity: 1; }
.drawer {
    position: fixed; top: 0; inset-inline-end: -100%; width: 340px; max-width: 86vw;
    height: 100vh; background: var(--bg); z-index: 2600;
    padding: 28px 22px; transition: inset-inline-end 0.3s cubic-bezier(0.4,0,0.2,1);
    display: flex; flex-direction: column; box-shadow: -10px 0 60px rgba(0,0,0,0.3);
    border-inline-start: 1px solid var(--border);
}
.drawer.open { inset-inline-end: 0; }
.drawer-start { inset-inline-start: -100%; inset-inline-end: auto; border-inline-start: none; border-inline-end: 1px solid var(--border); box-shadow: 10px 0 60px rgba(0,0,0,0.3); }
.drawer-start.open { inset-inline-start: 0; inset-inline-end: auto; }

/* ============ TOAST ============ */
.toasts-container {
    position: fixed; top: 92px; inset-inline-end: 22px; z-index: 4000;
    display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
    min-width: 280px; max-width: 380px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 14px 18px;
    display: flex; align-items: flex-start; gap: 12px;
    box-shadow: var(--shadow-hover);
    transform: translateX(calc(100% + 40px));
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    pointer-events: auto;
}
.toasts-container:dir(ltr) .toast { transform: translateX(calc(100% + 40px)); }
.toasts-container:dir(rtl) .toast { transform: translateX(calc(-100% - 40px)); }
.toast.show { transform: translateX(0) !important; }
.toast-icon {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 0.85rem;
}
.toast-success .toast-icon { background: rgba(46,204,113,0.2); color: var(--success); }
.toast-error .toast-icon { background: rgba(231,76,60,0.2); color: var(--danger); }
.toast-warning .toast-icon { background: rgba(241,196,15,0.2); color: var(--warning); }
.toast-info .toast-icon { background: rgba(0,212,255,0.2); color: var(--accent); }
.toast-content { flex: 1; }
.toast-title { font-weight: 800; font-size: 0.92rem; }
.toast-message { color: var(--text-secondary); font-size: 0.85rem; margin-top: 3px; line-height: 1.5; }
.toast-close {
    background: transparent; border: none; color: var(--text-muted); cursor: pointer;
    padding: 2px; font-size: 1rem; transition: var(--transition-fast);
}
.toast-close:hover { color: var(--danger); }

/* ============ ALERT ============ */
.alert {
    display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius-sm); margin-bottom: 16px;
}
.alert-icon { font-size: 1.1rem; margin-top: 2px; flex-shrink: 0; }
.alert-content { flex: 1; }
.alert-title { font-weight: 800; font-size: 0.95rem; }
.alert-message { color: var(--text-secondary); font-size: 0.9rem; margin-top: 3px; line-height: 1.6; }
.alert-success { background: rgba(46,204,113,0.10); border-color: rgba(46,204,113,0.3); color: var(--success); }
.alert-success .alert-message { color: #a0dcb4; }
[data-theme="light"] .alert-success .alert-message { color: #1b7a40; }
.alert-error { background: rgba(231,76,60,0.10); border-color: rgba(231,76,60,0.3); color: var(--danger); }
.alert-error .alert-message { color: #f0a29b; }
[data-theme="light"] .alert-error .alert-message { color: #a53324; }
.alert-warning { background: rgba(241,196,15,0.10); border-color: rgba(241,196,15,0.3); color: var(--warning); }
.alert-warning .alert-message { color: #e3d37f; }
[data-theme="light"] .alert-warning .alert-message { color: #8a6d08; }
.alert-info { background: rgba(0,212,255,0.10); border-color: rgba(0,212,255,0.3); color: var(--accent); }
.alert-info .alert-message { color: #88e0f1; }
[data-theme="light"] .alert-info .alert-message { color: #0a8099; }

/* ============ DROPDOWN ============ */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    position: absolute; top: calc(100% + 8px); inset-inline-start: 0;
    min-width: 220px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 8px; box-shadow: var(--shadow-hover);
    opacity: 0; pointer-events: none; transform: translateY(-8px);
    transition: var(--transition-fast); z-index: 1200;
}
.dropdown-menu-end { inset-inline-start: auto; inset-inline-end: 0; }
.dropdown.open .dropdown-menu { opacity: 1; pointer-events: auto; transform: translateY(0); }
.dropdown-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 8px; cursor: pointer;
    font-weight: 600; font-size: 0.9rem; color: var(--text-secondary);
    transition: var(--transition-fast);
}
.dropdown-item:hover { background: var(--primary-light); color: var(--primary); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: rgba(231,76,60,0.12); color: var(--danger); }
.dropdown-divider {
    height: 1px; background: var(--border); margin: 6px 0;
}

/* ============ SKELETON ============ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text { height: 14px; margin-bottom: 10px; }
.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 70%; }
.skeleton-circle { border-radius: 50%; }
.skeleton-image { height: 200px; border-radius: var(--radius) var(--radius) 0 0; }

/* ============ LOADING, EMPTY, ERROR STATES ============ */
.loading-state, .empty-state, .error-state {
    padding: 80px 24px; text-align: center;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.spinner {
    width: 52px; height: 52px; border: 4px solid var(--bg-secondary);
    border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-sm { width: 24px; height: 24px; border-width: 3px; }
.loading-text { color: var(--text-muted); font-weight: 600; }
.empty-state-icon, .error-state-icon {
    width: 96px; height: 96px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
    background: var(--bg-secondary);
    color: var(--text-muted);
}
.empty-state-icon { color: var(--primary); background: var(--primary-light); }
.error-state-icon { color: var(--danger); background: rgba(231,76,60,0.15); }
.empty-state-title, .error-state-title {
    font-size: 1.3rem; font-weight: 800;
}
.empty-state-desc, .error-state-desc {
    color: var(--text-secondary); max-width: 440px; line-height: 1.7;
}

/* ============ TIMELINE ============ */
.timeline { position: relative; padding: 20px 0; }
.timeline::before {
    content: ""; position: absolute; top: 0; bottom: 0;
    inset-inline-start: 18px; width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding-inline-start: 60px; margin-bottom: 28px; }
.timeline-dot {
    position: absolute; top: 2px; inset-inline-start: 10px;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--primary); border: 4px solid var(--bg);
    box-shadow: 0 0 0 2px var(--primary-light);
}
.timeline-dot.success { background: var(--success); box-shadow: 0 0 0 2px rgba(46,204,113,0.2); }
.timeline-dot.danger { background: var(--danger); box-shadow: 0 0 0 2px rgba(231,76,60,0.2); }
.timeline-time { font-size: 0.78rem; color: var(--text-muted); font-weight: 700; }
.timeline-title { font-weight: 800; font-size: 1rem; margin-top: 4px; }
.timeline-desc { color: var(--text-secondary); font-size: 0.9rem; margin-top: 6px; line-height: 1.6; }

/* ============ PAGE HERO (INNER PAGES) ============ */
.page-hero {
    min-height: 340px;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg));
    padding: 140px 0 80px;
    position: relative; overflow: hidden;
}
.page-hero::before, .page-hero::after {
    content: ""; position: absolute; width: 450px; height: 450px;
    border-radius: 50%; filter: blur(90px); opacity: 0.15; pointer-events: none;
}
.page-hero::before { background: var(--primary); top: -200px; inset-inline-end: -150px; }
.page-hero::after { background: var(--secondary); bottom: -250px; inset-inline-start: -200px; }
.page-hero-breadcrumb {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 0.9rem; color: var(--text-muted);
    margin-bottom: 20px; position: relative; z-index: 2;
}
.page-hero-breadcrumb a:hover { color: var(--primary); }
.page-hero-breadcrumb-sep { opacity: 0.5; }
.page-hero-title {
    font-size: clamp(2rem, 5vw, 3rem); font-weight: 900; line-height: 1.15;
    position: relative; z-index: 2; margin-bottom: 12px;
}
.page-hero-title span {
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.page-hero-subtitle {
    color: var(--text-secondary); font-size: 1.05rem; max-width: 620px; line-height: 1.8;
    position: relative; z-index: 2;
}

/* ============ GRID HELPERS ============ */
.grid { display: grid; gap: 24px; }
.grid-cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }
.section { padding: 90px 0; }
.section-title {
    font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 900;
    margin-bottom: 12px; line-height: 1.2;
}
.section-title-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.section-subtitle {
    color: var(--text-secondary); max-width: 640px; line-height: 1.8; margin-bottom: 48px;
}
.section-header { margin-bottom: 52px; }

/* ============ SCROLL TO TOP ============ */
.scroll-top {
    position: fixed; bottom: 30px; inset-inline-end: 30px;
    width: 50px; height: 50px; border-radius: 50%;
    background: var(--primary); color: #fff; border: none; cursor: pointer;
    box-shadow: var(--shadow-primary);
    display: none; align-items: center; justify-content: center;
    z-index: 1100; transition: var(--transition); font-size: 1.1rem;
}
.scroll-top.visible { display: flex; opacity: 0; }
.scroll-top.show { opacity: 1; }
.scroll-top:hover { transform: translateY(-4px); }

/* ============ RESPONSIVE COMPONENT HELPERS ============ */
@media (max-width: 768px) {
    .card, .stat-card { padding: 20px; }
    .data-table th, .data-table td { padding: 10px 12px; font-size: 0.85rem; }
    .section { padding: 64px 0; }
    .news-card-body, .event-card-body, .tool-card-body, .project-card-body, .service-card-body, .job-card-body { padding: 18px; }
    .toast { min-width: 260px; }
    .toasts-container { inset-inline-end: 12px; top: 80px; }
}
@media (max-width: 480px) {
    .user-card { flex-direction: column; text-align: center; }
    .tabs { padding: 3px; }
    .tab { padding: 8px 14px; font-size: 0.82rem; }
}

/* ============ RTL ADJUSTMENTS FOR GLOBAL COMPONENTS ============ */
[dir="rtl"] .stat-card { text-align: right; }
[dir="rtl"] .form-select {
    background-position: calc(0% + 20px) 50%, calc(0% + 12px) 50%;
}
