/* assets/css/components.css - Reusable UI components */

/* ============================================================================
   BREADCRUMBS
   ============================================================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 0;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.breadcrumb a {
    color: #7f8c8d;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: #3498db;
    text-decoration: none;
}

.breadcrumb-separator {
    color: #bdc3c7;
    font-size: 0.8rem;
    user-select: none;
}

.breadcrumb-current {
    color: #2c3e50;
    font-weight: 500;
}

/* ============================================================================
   PAGE HEADER COMPONENTS
   ============================================================================ */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.page-title {
    font-size: 2rem;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.page-description {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 0;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
    font-weight: 500;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    text-decoration: none;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    text-decoration: none;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
    text-decoration: none;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    text-decoration: none;
}

.btn-small,
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ============================================================================
   CARDS
   ============================================================================ */
.card {
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: background-color 0.3s ease;
}

.card-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease;
}

.card-header h3 {
    margin: 0;
}

.card-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 1rem;
    transition: border-color 0.3s ease;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   FORMS
   ============================================================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group .help-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.form-group .error-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #e74c3c;
}

.form-inline {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.form-inline .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Standalone form classes (for use without .form-group wrapper) */
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #7f8c8d;
    font-style: italic;
}

.form-error {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #e74c3c;
    font-weight: 500;
}

/* ============================================================================
   TABLES
   ============================================================================ */
/* Generic table element styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th,
td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

td {
    color: #555;
}

/* Class-based table styling */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.table th {
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table-striped tbody tr:nth-child(even) {
    background: #fafafa;
}

.table-striped tbody tr:nth-child(even):hover {
    background: #f5f5f5;
}

@media (max-width: 768px) {

    table,
    .table {
        font-size: 0.9rem;
    }

    th,
    td,
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
}

/* ============================================================================
   ALERTS & MESSAGES
   ============================================================================ */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    display: none;
}

.alert.show {
    display: block;
}

.alert-info {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #1565c0;
}

.alert-success {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.alert-warning {
    background: #fff3e0;
    border-color: #ff9800;
    color: #e65100;
}

.alert-error,
.alert-danger {
    background: #ffebee;
    border-color: #f44336;
    color: #c62828;
}

/* ============================================================================
   BADGES
   ============================================================================ */
.badge {
    display: inline-block;
    padding: 0.25rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: #3498db;
    color: white;
}

.badge-success {
    background: #27ae60;
    color: white;
}

.badge-warning {
    background: #f39c12;
    color: white;
}

.badge-danger {
    background: #e74c3c;
    color: white;
}

.badge-info {
    background: #3498db;
    color: white;
}

.badge-secondary {
    background: #95a5a6;
    color: white;
}

/* ============================================================================
   GRID SYSTEMS
   ============================================================================ */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   STATS CARDS
   ============================================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    padding: 1.5rem;
    border-radius: 8px;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    opacity: 0.9;
    font-size: 1rem;
}

.stat-card-purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card-blue {
    background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);
}

.stat-card-green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-card-orange {
    background: linear-gradient(135deg, #ee9617 0%, #fe5858 100%);
}

/* ============================================================================
   BREADCRUMB
   ============================================================================ */
.breadcrumb {
    margin-bottom: 1.5rem;
    color: #7f8c8d;
    font-size: 0.95rem;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ============================================================================
   LOADING SPINNER
   ============================================================================ */
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    display: none;
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
}

.loading.show {
    display: block;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ============================================================================
   HERO SECTION
   ============================================================================ */
.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.hero p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

.hero .btn {
    margin: 0 0.5rem;
}

@media (max-width: 768px) {
    .hero h2 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }
}

/* ============================================================================
   TABS
   ============================================================================ */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    color: #7f8c8d;
    transition: all 0.2s;
}

.tab:hover {
    color: #2c3e50;
    background: #f8f9fa;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================================================
   FORM LAYOUT UTILITIES
   ============================================================================ */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.form-row-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {

    .form-row,
    .form-row-3,
    .form-row-4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   INFO CARDS / STAT CARDS
   ============================================================================ */
.info-grid,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-card,
.stat-card {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.info-card:hover,
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.info-card h3,
.stat-card h3,
.stat-label {
    font-size: 0.85rem;
    color: #7f8c8d;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.info-card .value,
.stat-value {
    font-size: 1.8rem;
    color: #2c3e50;
    font-weight: 700;
    line-height: 1.2;
}

.info-card .unit {
    font-size: 1rem;
    color: #7f8c8d;
    font-weight: normal;
}

/* Info Card Color Variants - Dused colors with strong border */
.info-card-purple,
.stat-card-purple {
    border-left-color: #667eea;
}

.info-card-pink,
.stat-card-pink {
    border-left-color: #f5576c;
}

.info-card-blue,
.stat-card-blue {
    border-left-color: #5b9bd5;
}

.info-card-green,
.stat-card-green {
    border-left-color: #56ab2f;
}

.info-card-orange,
.stat-card-orange {
    border-left-color: #f39c12;
}

.info-card-red,
.stat-card-red {
    border-left-color: #e74c3c;
}

@media (max-width: 768px) {

    .info-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }
}