/* ===== SHARED VIEWS DESIGN SYSTEM ===== */
/* This file provides consistent styling for all backend views */
/* while keeping user views unchanged */

/* Import the existing design system */
@import url('site.css');

/* ===== ENHANCED DESIGN SYSTEM FOR ALL VIEWS ===== */

/* Extended Color Variables - Dashboard Theme */
:root {
    /* Keep in sync with site.css index variables */
    --index-primary-bg: #FFFFFF;
    --index-text-dark: #111827;
    --index-primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --index-primary-color: #667eea;
    --index-secondary-color: #764ba2;
    --index-accent-orange: #f5576c;
    --index-accent-blue: #667eea;
    --index-border-light: #e5e7eb;
    --index-shadow-soft: 0 2px 8px rgba(15, 23, 42, 0.08);
    --index-shadow-medium: 0 4px 16px rgba(15, 23, 42, 0.18);
    --index-hover-bg: rgba(102, 126, 234, 0.06);
    
    /* Additional colors for enhanced design */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --light-bg: #f8fafc;
    --dark-text: #1f2937;
    --muted-text: #6b7280;
}

/* ===== UNIVERSAL VIEW CONTAINER ===== */
.shared-view-container {
    background: var(--index-primary-bg);
    min-height: 100vh;
    padding: 2rem;
}

/* ===== ENHANCED PAGE HEADER ===== */
.shared-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--index-border-light);
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    box-shadow: var(--index-shadow-soft);
}

.shared-page-title {
    color: var(--index-text-dark);
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.shared-page-subtitle {
    color: var(--muted-text);
    font-size: 1rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
    font-weight: 400;
}

.shared-page-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ===== ENHANCED BUTTON SYSTEM ===== */
.btn-shared-primary {
    background: var(--index-primary-gradient);
    border: 2px solid var(--index-primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-shared-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    border-color: #764ba2;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--index-shadow-medium);
}

.btn-shared-secondary {
    background: var(--index-accent-blue);
    border: 2px solid var(--index-accent-blue);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-shared-secondary:hover {
    background: #764ba2;
    border-color: #764ba2;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--index-shadow-medium);
}

.btn-shared-success {
    background: var(--success-color);
    border: 2px solid var(--success-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-shared-success:hover {
    background: #059669;
    border-color: #059669;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--index-shadow-medium);
}

.btn-shared-danger {
    background: var(--danger-color);
    border: 2px solid var(--danger-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-shared-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--index-shadow-medium);
}

/* ===== ENHANCED CARD SYSTEM ===== */
.shared-content-card {
    background: var(--index-primary-bg);
    border: 1px solid var(--index-border-light);
    border-radius: 12px;
    box-shadow: var(--index-shadow-soft);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.shared-content-card:hover {
    box-shadow: var(--index-shadow-medium);
    border-color: var(--index-primary-color);
}

.shared-card-header {
    background: var(--index-primary-gradient);
    color: white;
    padding: 1.25rem 1.5rem;
    border-bottom: none;
}

.shared-card-title {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.shared-card-body {
    padding: 1.5rem;
}

/* ===== ENHANCED GRIDVIEW STYLING ===== */
.shared-gridview {
    background: transparent;
    border: none;
    box-shadow: none;
}

.shared-gridview .table {
    background: var(--index-primary-bg);
    border: 1px solid var(--index-border-light);
    border-radius: 8px;
    overflow: hidden;
    margin: 0;
    font-size: 0.9rem;
}

.shared-gridview .table thead th {
    background: #f8f9fa;
    color: var(--dark-text);
    font-weight: 600;
    border: none;
    padding: 1rem 0.75rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--index-border-light);
}

.shared-gridview .table tbody td {
    border-color: var(--index-border-light);
    vertical-align: middle;
    color: var(--index-text-dark);
    padding: 0.875rem 0.75rem;
}

.shared-gridview .table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--index-border-light);
}

.shared-gridview .table tbody tr:hover {
    background: var(--index-hover-bg);
    transform: scale(1.005);
}

.shared-gridview .table tbody tr:last-child {
    border-bottom: none;
}

/* ===== ENHANCED ACTION BUTTONS ===== */
.shared-action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.btn-shared-view {
    background: var(--index-accent-blue);
    border: 1px solid var(--index-accent-blue);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}

.btn-shared-view-view {
    background: var(--index-accent-blue);
    border: 2px solid var(--index-accent-blue);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}

.btn-shared-view:hover {
    background: #764ba2;
    border-color: #764ba2;
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--index-shadow-soft);
}

.btn-shared-edit {
    background: var(--index-primary-gradient);
    border: 1px solid var(--index-primary-color);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}

.btn-shared-edit:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    border-color: #764ba2;
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--index-shadow-soft);
}

.btn-shared-delete {
    background: var(--danger-color);
    border: 1px solid var(--danger-color);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}

.btn-shared-view-edit {
    background: var(--index-primary-gradient);
    border: 2px solid var(--index-primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap:0.5rem;
    font-weight: 600;
}

.btn-shared-delete:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--index-shadow-soft);
}

/* ===== ENHANCED BADGES ===== */
.shared-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shared-badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.shared-badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.shared-badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.shared-badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.shared-badge-secondary {
    background: rgba(107, 114, 128, 0.1);
    color: var(--muted-text);
    border: 1px solid rgba(107, 114, 128, 0.2);
}

/* ===== ENHANCED FORM STYLING ===== */
.shared-form-container {
    background: var(--index-primary-bg);
    border: 1px solid var(--index-border-light);
    border-radius: 12px;
    box-shadow: var(--index-shadow-soft);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.shared-form-title {
    color: var(--index-text-dark);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--index-border-light);
}

.shared-form-group {
    margin-bottom: 1.5rem;
}

.shared-form-label {
    color: var(--dark-text);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
    font-size: 0.9rem;
}

.shared-form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--index-border-light);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: var(--index-primary-bg);
}

.shared-form-control:focus {
    border-color: var(--index-primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.shared-form-help {
    color: var(--muted-text);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* ===== ENHANCED DETAIL VIEW ===== */
.shared-detail-container {
    background: var(--index-primary-bg);
    border: 1px solid var(--index-border-light);
    border-radius: 12px;
    box-shadow: var(--index-shadow-soft);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.shared-detail-header {
    background: var(--index-primary-gradient);
    color: white;
    padding: 1.5rem;
    border-bottom: none;
}

.shared-detail-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.shared-detail-body {
    padding: 1.5rem;
}

.shared-detail-row {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--index-border-light);
}

.shared-detail-row:last-child {
    border-bottom: none;
}

.shared-detail-label {
    font-weight: 600;
    color: var(--dark-text);
    width: 200px;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.shared-detail-value {
    color: var(--index-text-dark);
    flex: 1;
    font-size: 0.9rem;
}

/* ===== ENHANCED FILTER SECTION ===== */
.shared-filter-container {
    background: #f8f9fa;
    border: 1px solid var(--index-border-light);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.shared-filter-title {
    color: var(--index-text-dark);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shared-filter-row {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.shared-filter-group {
    flex: 1;
    min-width: 200px;
}

.shared-filter-label {
    color: var(--dark-text);
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
    font-size: 0.85rem;
}

.shared-filter-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--index-border-light);
    border-radius: 6px;
    font-size: 0.85rem;
    background: var(--index-primary-bg);
    transition: all 0.3s ease;
}

.shared-filter-control:focus {
    border-color: var(--index-primary-color);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* ===== ENHANCED PAGINATION ===== */
.shared-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    padding: 1rem;
}

.shared-pagination .pagination {
    margin: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--index-shadow-soft);
    display: flex;
    gap: 5px;
}

.shared-pagination .page-item {
    list-style: none;
}

.shared-pagination .page-link {
    color: #667eea;
    border: 2px solid var(--index-border-light);
    padding: 0.75rem 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 8px;
    background: white;
    min-width: 45px;
    justify-content: center;
}

.shared-pagination .page-link:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: var(--index-shadow-medium);
}

.shared-pagination .page-item.active .page-link {
    background: var(--index-primary-gradient);
    border-color: var(--index-primary-color);
    color: white;
    font-weight: 700;
    box-shadow: var(--index-shadow-soft);
}

.shared-pagination .page-item.disabled .page-link {
    color: var(--muted-text);
    border-color: var(--index-border-light);
    background: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.6;
    height: 100%;
    display: flex !important;
}

.shared-pagination .page-item.disabled .page-link:hover {
    background: #f8f9fa;
    color: var(--muted-text);
    border-color: var(--index-border-light);
    transform: none;
    box-shadow: none;
}

.shared-pagination .page-item.disabled span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    height: 100%;
}

.shared-pagination .page-link i {
    font-size: 0.8rem;
}

.shared-pagination .page-item:last-child .page-link {
    border-right: 2px solid var(--index-border-light);
}

.shared-pagination .page-item:last-child.active .page-link {
    border-right: 2px solid var(--index-primary-color);
}

.shared-pagination .page-item:last-child.disabled .page-link {
    border-right: 2px solid var(--index-border-light);
}

.shared-pagination .page-item:last-child .page-link:hover {
    border-right: 2px solid #667eea;
}

/* ===== ENHANCED ALERTS ===== */
.shared-alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.shared-alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.shared-alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.shared-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.shared-alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: var(--info-color);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1199px) {
    .shared-view-container {
        padding: 1.5rem;
    }
    
    .shared-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .shared-page-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .shared-view-container {
        padding: 1rem;
    }
    
    .shared-page-title {
        font-size: 1.75rem;
    }
    
    .shared-card-body {
        padding: 1rem;
    }
    
    .shared-gridview .table {
        font-size: 0.8rem;
    }
    
    .shared-gridview .table thead th,
    .shared-gridview .table tbody td {
        padding: 0.75rem 0.5rem;
    }
    
    .shared-action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn-shared-view,
    .btn-shared-edit,
    .btn-shared-delete {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .shared-filter-row {
        flex-direction: column;
    }
    
    .shared-filter-group {
        min-width: 100%;
    }
}

@media (max-width: 575px) {
    .shared-view-container {
        padding: 0.75rem;
    }
    
    .shared-page-title {
        font-size: 1.5rem;
    }
    
    .shared-page-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-shared-primary,
    .btn-shared-secondary,
    .btn-shared-success,
    .btn-shared-danger {
        width: 100%;
        justify-content: center;
    }
    
    .shared-gridview .table {
        font-size: 0.75rem;
    }
    
    .shared-gridview .table thead th,
    .shared-gridview .table tbody td {
        padding: 0.5rem 0.25rem;
    }
}

/* ===== UTILITY CLASSES ===== */
.shared-text-center { text-align: center; }
.shared-text-right { text-align: right; }
.shared-text-left { text-align: left; }

.shared-mb-0 { margin-bottom: 0; }
.shared-mb-1 { margin-bottom: 0.5rem; }
.shared-mb-2 { margin-bottom: 1rem; }
.shared-mb-3 { margin-bottom: 1.5rem; }
.shared-mb-4 { margin-bottom: 2rem; }

.shared-mt-0 { margin-top: 0; }
.shared-mt-1 { margin-top: 0.5rem; }
.shared-mt-2 { margin-top: 1rem; }
.shared-mt-3 { margin-top: 1.5rem; }
.shared-mt-4 { margin-top: 2rem; }

.shared-p-0 { padding: 0; }
.shared-p-1 { padding: 0.5rem; }
.shared-p-2 { padding: 1rem; }
.shared-p-3 { padding: 1.5rem; }
.shared-p-4 { padding: 2rem; }

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

.shared-justify-content-center { justify-content: center; }
.shared-justify-content-between { justify-content: space-between; }
.shared-justify-content-end { justify-content: flex-end; }

.shared-align-items-center { align-items: center; }
.shared-align-items-start { align-items: flex-start; }
.shared-align-items-end { align-items: flex-end; }

.shared-gap-1 { gap: 0.5rem; }
.shared-gap-2 { gap: 1rem; }
.shared-gap-3 { gap: 1.5rem; }
.shared-gap-4 { gap: 2rem; }

/* ===== LOADING STATES ===== */
.shared-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: var(--muted-text);
}

.shared-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--index-border-light);
    border-top: 2px solid var(--index-primary-color);
    border-radius: 50%;
    animation: shared-spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes shared-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== EMPTY STATES ===== */
.shared-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted-text);
}

.shared-empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.shared-empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-text);
}

.shared-empty-state-description {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ===== PRINT STYLES ===== */
@media print {
    .shared-page-actions,
    .shared-action-buttons,
    .shared-pagination {
        display: none !important;
    }
    
    .shared-view-container {
        padding: 0;
        background: white;
    }
    
    .shared-content-card,
    .shared-detail-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
