/* Common Components CSS */

/* Dropdown Menu Component */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 10000;
    min-width: 180px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    padding: 8px 0;
    margin-top: 4px;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu-up {
    top: auto !important;
    bottom: 100% !important;
    margin-top: 0 !important;
    margin-bottom: 4px !important;
    transform: translateY(10px);
}

.dropdown-menu-up.show {
    transform: translateY(0);
}

.dropdown-menu-down {
    top: 100% !important;
    bottom: auto !important;
    margin-top: 4px !important;
    margin-bottom: 0 !important;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 14px;
    font-weight: normal;
    font-family: inherit;
    line-height: 1.4;
    transition: background-color 0.2s ease;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: var(--bg-hover);
    color: var(--text-color);
}

.dropdown-item:focus {
    outline: none;
    background-color: var(--bg-hover);
}

/* Horizontal dropdown menu */
.dropdown-horizontal .dropdown-menu {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    min-width: auto;
    white-space: nowrap;
}

.dropdown-horizontal .dropdown-menu .dropdown-item {
    display: inline-block !important;
    width: auto !important;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 4px;
    margin: 0;
    transition: all 0.2s;
}

.dropdown-horizontal .dropdown-menu .dropdown-item:hover:not(.disabled) {
    background: var(--primary-color);
    color: white;
}

.dropdown-horizontal .dropdown-menu .dropdown-item.dropdown-item-danger {
    color: #dc2626;
}

.dropdown-horizontal .dropdown-menu .dropdown-item.dropdown-item-danger:hover:not(.disabled) {
    background: #dc2626;
    color: white;
}

.dropdown-horizontal .dropdown-menu .dropdown-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Table with visible overflow for dropdowns */
.table-overflow-visible {
    overflow: visible;
}

/* Modal Components */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header.message-success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-bottom: 2px solid #059669;
}

.modal-header.message-error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-bottom: 2px solid #dc2626;
}

.modal-header.message-warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-bottom: 2px solid #d97706;
}

.modal-header.message-success .modal-title,
.modal-header.message-error .modal-title,
.modal-header.message-warning .modal-title {
    color: #1f2937;
    font-weight: 600;
}

.modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

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

.modal-body {
    padding: 24px;
}

.modal-body p {
    margin: 0 0 20px 0;
    color: var(--text-primary);
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Deleted items styling */
.deleted-item {
    color: rgba(107, 114, 128, 0.7) !important; /* Gray-500 at 70% opacity for better readability */
}

.deleted-item * {
    color: inherit !important;
}

/* Dropdown container */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Alert Components */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-info {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
}

.alert-warning {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.alert-success {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}

.alert-error, .alert-danger {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

/* Button Components */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

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

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

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

.btn-danger {
    background: var(--danger-color);
    color: var(--text-color);
    border-color: var(--danger-color);
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: var(--text-color);
    border-color: var(--success-color);
}

.btn-success:hover:not(:disabled) {
    background: var(--success-dark);
    border-color: var(--success-dark);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: var(--text-color);
    border-color: var(--warning-color);
}

.btn-warning:hover:not(:disabled) {
    background: var(--warning-dark);
    border-color: var(--warning-dark);
    color: white;
}

.btn-outline, .btn-secondary {
    background: var(--secondary-color);
    color: var(--text-color);
    border-color: var(--border-color);
}

.btn-outline:hover:not(:disabled), .btn-secondary:hover:not(:disabled) {
    background: var(--secondary-dark);
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-icon {
    padding: 6px 10px;
}

/* Button width utilities */
.btn-min-w-120 {
    min-width: 120px;
    text-align: center;
    justify-content: center;
}

/* Button normalization for consistent height */
button.btn, input[type="submit"].btn, input[type="button"].btn {
    height: auto;
    line-height: 1.5;
    box-sizing: border-box;
}

a.btn {
    height: auto;
    line-height: 1.5;
    box-sizing: border-box;
}

/* Badge Components */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-admin {
    background: #fef3c7;
    color: #92400e;
}

.badge-user {
    background: #dbeafe;
    color: #1e40af;
}

.badge-expositor {
    background: #d1fae5;
    color: #065f46;
}

/* Form Components */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: var(--card-bg);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Layout Utilities */
.d-flex {
    display: flex;
}

.d-inline-flex {
    display: inline-flex;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.align-center {
    align-items: center;
}

.gap-4 {
    gap: 4px;
}

.gap-6 {
    gap: 6px;
}

.gap-8 {
    gap: 8px;
}

.gap-10 {
    gap: 10px;
}

.gap-12 {
    gap: 12px;
}

/* Typography Utilities */
.font-weight-600 {
    font-weight: 600;
}

.font-size-13 {
    font-size: 13px;
}

.font-size-14 {
    font-size: 14px;
}

.font-size-16 {
    font-size: 16px;
}

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

.text-secondary {
    color: var(--text-secondary);
}

/* Spacing Utilities */
.mb-20 {
    margin-bottom: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-24 {
    margin-bottom: 24px;
}

.mt-12 {
    margin-top: 12px;
}

.mt-20 {
    margin-top: 20px;
}

/* Padding Utilities */
.p-4 {
    padding: 4px;
}

.p-8 {
    padding: 8px;
}

.p-12 {
    padding: 12px;
}

.p-16 {
    padding: 16px;
}

.p-20 {
    padding: 20px;
}

.px-12 {
    padding-left: 12px;
    padding-right: 12px;
}

.px-16 {
    padding-left: 16px;
    padding-right: 16px;
}

.py-8 {
    padding-top: 8px;
    padding-bottom: 8px;
}

.py-12 {
    padding-top: 12px;
    padding-bottom: 12px;
}

/* Text Alignment */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

/* Table Components */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-primary);
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

/* Card Variations */
.card-sm {
    padding: 16px;
}

.card-lg {
    padding: 32px;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
    border-radius: 12px 12px 0 0;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
    border-radius: 0 0 12px 12px;
}

/* Status Colors */
.status-active {
    color: #10b981;
}

.status-inactive {
    color: #6b7280;
}

.status-deleted {
    color: #dc2626;
}

/* Avatar Components */
.avatar {
    border-radius: 50%;
    object-fit: cover;
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-md {
    width: 48px;
    height: 48px;
}

.avatar-lg {
    width: 64px;
    height: 64px;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}
