/* ============================================================
   Nashat International — Component Styles
   Reusable UI components: buttons, cards, forms, badges
   ============================================================ */

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-8);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-wide);
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    line-height: 1.5;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::after {
    opacity: 1;
}

.btn-primary {
    background: var(--gold);
    color: var(--text-white);
    border-color: var(--gold);
}

.btn-primary:hover {
    background: var(--gold-dark);
    border-color: var(--gold-dark);
    color: var(--text-white);
    box-shadow: var(--shadow-gold);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--gold-border);
}

.btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--gold-glow);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: var(--space-2) var(--space-4);
}

.btn-ghost:hover {
    color: var(--gold);
    background: var(--gold-glow);
}

.btn-sm {
    padding: var(--space-2) var(--space-5);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--space-4) var(--space-10);
    font-size: var(--text-base);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-lg);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: var(--gold-border-hover);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-4px);
}

.card-solid {
    background: var(--bg-card-solid);
    backdrop-filter: none;
}

.card-flat {
    background: var(--bg-card-solid);
    border: none;
    box-shadow: var(--shadow-card);
}

.card-flat:hover {
    box-shadow: var(--shadow-card-hover);
}

.card-compact {
    padding: var(--space-6);
}

/* ── Form Elements ─────────────────────────────────────────── */
.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
    letter-spacing: var(--tracking-wide);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--space-3) var(--space-5);
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text-primary);
    background: var(--bg-white);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-light);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7089' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-error {
    font-size: var(--text-xs);
    color: #e74c3c;
    margin-top: var(--space-1);
}

.form-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-1);
}

.form-input.is-error,
.form-textarea.is-error {
    border-color: #e74c3c;
}

.form-input.is-error:focus,
.form-textarea.is-error:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* ── Badges ────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    border-radius: var(--radius-full);
    letter-spacing: var(--tracking-wide);
    line-height: 1.5;
}

.badge-gold {
    background: var(--gold-glow);
    color: var(--gold-dark);
    border: 1px solid var(--gold-border);
}

.badge-green {
    background: rgba(46, 204, 113, 0.1);
    color: #27ae60;
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.badge-blue {
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.badge-red {
    background: rgba(231, 76, 60, 0.1);
    color: #c0392b;
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.badge-orange {
    background: rgba(230, 126, 34, 0.1);
    color: #d35400;
    border: 1px solid rgba(230, 126, 34, 0.2);
}

.badge-gray {
    background: rgba(127, 140, 141, 0.1);
    color: #636e72;
    border: 1px solid rgba(127, 140, 141, 0.2);
}

/* ── Toast Notifications ───────────────────────────────────── */
.toast-container {
    position: fixed;
    top: calc(var(--navbar-height) + var(--space-4));
    right: var(--space-6);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    background: var(--bg-white);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-size: var(--text-sm);
    min-width: 300px;
    max-width: 450px;
    animation: slideInRight 0.4s ease;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}

.toast-success::before { background: #2ecc71; }
.toast-error::before   { background: #e74c3c; }
.toast-warning::before { background: #f39c12; }
.toast-info::before    { background: #3498db; }

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: var(--space-1);
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast.removing {
    animation: slideOutRight 0.3s ease forwards;
}

/* ── Loading Spinner ───────────────────────────────────────── */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gold-glow);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-sm {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

/* ── Skeleton Loading ──────────────────────────────────────── */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-primary) 25%,
        rgba(182, 149, 66, 0.06) 50%,
        var(--bg-primary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 14px;
    margin-bottom: var(--space-2);
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: var(--space-4);
}

.skeleton-img {
    height: 200px;
    margin-bottom: var(--space-4);
}

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-8);
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: var(--text-5xl);
    margin-bottom: var(--space-6);
    opacity: 0.3;
}

.empty-state-title {
    font-size: var(--text-xl);
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.empty-state-text {
    font-size: var(--text-sm);
    max-width: 400px;
    margin: 0 auto;
}

/* ── Pagination ────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-12);
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
    background: var(--bg-white);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.pagination-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--gold-glow);
}

.pagination-btn.active {
    background: var(--gold);
    color: var(--text-white);
    border-color: var(--gold);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ── Breadcrumbs ───────────────────────────────────────────── */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-8);
}

.breadcrumbs a {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.breadcrumbs a:hover {
    color: var(--gold);
}

.breadcrumbs .separator {
    color: var(--text-light);
    font-size: var(--text-xs);
}

.breadcrumbs .current {
    color: var(--text-primary);
    font-weight: var(--weight-medium);
}

/* ── Tag / Chip ────────────────────────────────────────────── */
.tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--text-muted);
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tag:hover,
.tag.active {
    color: var(--gold);
    background: var(--gold-glow);
    border-color: var(--gold-border);
}

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    z-index: var(--z-overlay);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.3s ease;
    position: relative;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
}

.modal-title {
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    margin-top: var(--space-8);
}

/* ── Keyframes ─────────────────────────────────────────────── */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(100%); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}
