/* ═══════════════════════════════════════════════════════════
   IJS Website - Components
   Buttons, cards, forms, tables, tabs, pagination, badges
   ═══════════════════════════════════════════════════════════ */

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    min-height: 44px;
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--ijs-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--ijs-primary-dark);
    color: white;
}

.btn-secondary {
    background: var(--ijs-secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--ijs-secondary-dark);
    color: white;
}

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

.btn-outline:hover {
    border-color: var(--ijs-primary);
    color: var(--ijs-primary);
}

.btn-outline-white {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.btn-outline-white:hover {
    background: white;
    color: var(--ijs-dark);
}

.btn-ghost {
    background: transparent;
    color: var(--ijs-primary);
}

.btn-ghost:hover {
    background: var(--ijs-primary-light);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    min-height: 44px;
    font-size: var(--text-sm);
}

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

/* ── Cards ── */
.card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    border: 1px solid var(--ijs-border-light);
}

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

.card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.card:hover .card-image img {
    transform: scale(1.05);
}

.card-body {
    padding: var(--space-5);
}

.card-title {
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    margin-bottom: var(--space-2);
    color: var(--ijs-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    font-size: var(--text-sm);
    color: var(--ijs-text-light);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-3);
    font-size: var(--text-xs);
    color: var(--ijs-text-muted);
}

.card-badge {
    display: inline-flex;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    border-radius: var(--radius-full);
    position: absolute;
    top: var(--space-3);
    left: var(--space-3);
}

/* ── Forms ── */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ijs-dark);
    margin-bottom: var(--space-2);
}

.form-label .required {
    color: var(--color-danger);
    margin-left: var(--space-1);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    border: 1px solid var(--ijs-border);
    border-radius: var(--radius-md);
    background: white;
    transition: border-color var(--transition-fast);
    color: var(--ijs-text);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--ijs-primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--ijs-primary-light);
}

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

.form-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='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: var(--space-10);
}

.form-error {
    font-size: var(--text-sm);
    color: var(--color-danger);
    margin-top: var(--space-1);
}

.form-help {
    font-size: var(--text-sm);
    color: var(--ijs-text-muted);
    margin-top: var(--space-1);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 24px;
    height: 24px;
    accent-color: var(--ijs-primary);
}

/* Honeypot (hidden from users, visible to bots) */
.hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

/* ── Tables ── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--ijs-border-light);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: var(--ijs-bg-gray);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--ijs-text-light);
    padding: var(--space-3) var(--space-4);
    text-align: left;
    white-space: nowrap;
}

.table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--ijs-border-light);
    font-size: var(--text-sm);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: rgba(0, 0, 0, 0.01);
}

/* ── Tabs ── */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--ijs-border);
    margin-bottom: var(--space-8);
}

.tab-btn {
    padding: var(--space-3) var(--space-6);
    min-height: 44px;
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    color: var(--ijs-text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-fast);
    cursor: pointer;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.tab-btn:hover {
    color: var(--ijs-text);
}

.tab-btn.active {
    color: var(--ijs-primary);
    border-bottom-color: var(--ijs-primary);
    font-weight: var(--weight-semibold);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ── Pagination ── */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: var(--space-10);
}

.pagination ul {
    display: flex;
    gap: var(--space-1);
}

.pagination li {
    display: flex;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 var(--space-2);
    font-size: var(--text-sm);
    color: var(--ijs-text-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.pagination a:hover {
    background: var(--ijs-bg-gray);
    color: var(--ijs-primary);
}

.pagination .active span {
    background: var(--ijs-primary);
    color: white;
}

.pagination .disabled span {
    color: var(--ijs-border);
    cursor: not-allowed;
}

.pagination .ellipsis span {
    color: var(--ijs-text-muted);
}

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

.badge-primary {
    background: var(--ijs-primary-light);
    color: var(--ijs-primary);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-info);
}

/* ── Breadcrumb ── */
.breadcrumb {
    padding: var(--space-4) 0;
    margin-bottom: var(--space-4);
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--ijs-text-muted);
}

.breadcrumb-list li::after {
    content: '>';
    margin-left: var(--space-2);
    color: var(--ijs-border);
}

.breadcrumb-list li:last-child::after {
    display: none;
}

.breadcrumb-list a {
    color: var(--ijs-text-muted);
}

.breadcrumb-list a:hover {
    color: var(--ijs-primary);
}

.breadcrumb-list .current {
    color: var(--ijs-text);
    font-weight: var(--weight-medium);
}

/* ── Accordion ── */
.accordion-item {
    border-bottom: 1px solid var(--ijs-border-light);
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-5) 0;
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    color: var(--ijs-dark);
    cursor: pointer;
    background: none;
    border: none;
    text-align: left;
}

.accordion-icon {
    font-size: var(--text-xl);
    transition: transform var(--transition-fast);
}

.accordion-item.active .accordion-icon {
    transform: rotate(45deg);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
}

.accordion-item.active .accordion-body {
    max-height: 500px;
}

.accordion-content {
    padding-bottom: var(--space-5);
    color: var(--ijs-text-light);
    line-height: var(--leading-relaxed);
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    max-width: 500px;
    width: 90%;
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

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

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

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

.empty-state-icon {
    font-size: 48px;
    margin-bottom: var(--space-4);
    opacity: 0.3;
}

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

.empty-state-desc {
    font-size: var(--text-sm);
}

/* ── Accordion Aliases (PHP uses different class names) ── */
.accordion {
    border-top: 1px solid var(--ijs-border-light);
}

.accordion-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-5) 0;
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    color: var(--ijs-dark);
    cursor: pointer;
    background: none;
    border: none;
    border-bottom: 1px solid var(--ijs-border-light);
    text-align: left;
}

.accordion-trigger:hover {
    color: var(--ijs-primary);
}

.accordion-q {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.accordion-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
    border-bottom: 1px solid var(--ijs-border-light);
}

.accordion-answer.active {
    max-height: 500px;
}

.accordion-answer p {
    padding: var(--space-5) 0;
    color: var(--ijs-text-light);
    line-height: var(--leading-relaxed);
}

/* ── Badge Secondary ── */
.badge-secondary {
    background: var(--ijs-bg-gray);
    color: var(--ijs-text-muted);
}

/* ── Utility Classes ── */
.d-flex {
    display: flex;
}

.gap-2 {
    gap: var(--space-2);
}

.text-muted {
    color: var(--ijs-text-muted);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
