﻿/* Modern Component System for DentalNet */

/* ===== MODERN CARD SYSTEM ===== */
.card-modern {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.card-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-modern.card-interactive {
    cursor: pointer;
}

.card-modern.card-interactive:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Card Header */
.card-modern .card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.5rem 2rem;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.card-modern .card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.card-modern .card-header .card-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-modern .card-header .card-subtitle {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    font-size: 0.875rem;
    font-weight: 400;
}

.card-modern .card-header .card-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Card Body */
.card-modern .card-body {
    padding: 2rem;
}

.card-modern.card-compact .card-body {
    padding: 1.5rem;
}

/* Card Footer */
.card-modern .card-footer {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ===== MODERN TABLE SYSTEM ===== */
.table-modern {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
}

.table-modern .table {
    margin: 0;
    border: none;
}

.table-modern .table thead th {
    background: var(--gray-50);
    border: none;
    border-bottom: 2px solid var(--gray-200);
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-700);
}

.table-modern .table tbody td {
    border: none;
    border-bottom: 1px solid var(--gray-100);
    padding: 1rem 1.5rem;
    vertical-align: middle;
}

.table-modern .table tbody tr:hover {
    background: var(--gray-50);
}

.table-modern .table tbody tr:last-child td {
    border-bottom: none;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.table-actions .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* ===== MODERN FORM SYSTEM ===== */
.form-modern {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
}

.form-modern .form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.form-modern .form-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.form-modern .form-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-modern .form-group {
    margin-bottom: 1.5rem;
}

.form-modern .form-label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-modern .form-label.required::after {
    content: '*';
    color: var(--danger);
    margin-left: 0.25rem;
}

.form-modern .form-control {
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: white;
}

.form-modern .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
    outline: none;
}

.form-modern .form-control:hover {
    border-color: var(--gray-300);
}

.form-modern .input-group {
    position: relative;
}

.form-modern .input-group-text {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-right: none;
    color: var(--gray-500);
    border-radius: 8px 0 0 8px;
}

.form-modern .input-group .form-control {
    border-left: none;
    border-radius: 0 8px 8px 0;
}

/* ===== MODERN BUTTON SYSTEM ===== */
.btn-modern {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-modern:hover::before {
    left: 100%;
}

.btn-modern.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary);
}

.btn-modern.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-dark) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.28);
}

.btn-modern.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-modern.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-modern.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    border-color: transparent;
}

.btn-modern.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

/* Button Sizes */
.btn-modern.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-modern.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* ===== MODERN NAVIGATION ===== */
.nav-modern {
    background: white;
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    display: flex;
    gap: 0.25rem;
}

.nav-modern .nav-item {
    flex: 1;
}

.nav-modern .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    position: relative;
}

.nav-modern .nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.nav-modern .nav-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.28);
}

/* ===== MODERN BREADCRUMB ===== */
.breadcrumb-modern {
    background: transparent;
    padding: 0;
    margin: 0 0 2rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.breadcrumb-modern .breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-500);
}

.breadcrumb-modern .breadcrumb-item:not(:last-child)::after {
    content: '/';
    color: var(--gray-400);
    margin-left: 0.5rem;
}

.breadcrumb-modern .breadcrumb-item a {
    color: var(--gray-600);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-modern .breadcrumb-item a:hover {
    color: var(--primary);
}

.breadcrumb-modern .breadcrumb-item.active {
    color: var(--gray-900);
    font-weight: 500;
}

/* ===== MODERN ALERTS ===== */
.alert-modern {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.alert-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.alert-modern.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-left: 4px solid var(--success);
}

.alert-modern.alert-success::before {
    background: var(--success);
}

.alert-modern.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.alert-modern.alert-warning::before {
    background: var(--warning);
}

.alert-modern.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.alert-modern.alert-danger::before {
    background: var(--danger);
}

.alert-modern.alert-info {
    background: #f0f9ff;
    color: var(--text-strong);
    border-left: 4px solid var(--info);
}

.alert-modern.alert-info::before {
    background: var(--info);
}

.alert-modern .alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.alert-modern .alert-content {
    flex: 1;
}

.alert-modern .alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.alert-modern .alert-message {
    margin: 0;
    opacity: 0.9;
}

/* ===== MODERN BADGES ===== */
.badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-modern.badge-primary {
    background: #dbeafe;
    color: var(--primary-dark);
}

.badge-modern.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-modern.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-modern.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-modern.badge-info {
    background: #e0f2fe;
    color: var(--text-strong);
}

.badge-modern.badge-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* ===== MODERN LOADING STATES ===== */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== RESPONSIVE UTILITIES ===== */
@media (max-width: 768px) {
    .card-modern .card-header {
        padding: 1rem 1.5rem;
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .card-modern .card-body {
        padding: 1.5rem;
    }
    
    .form-modern {
        padding: 1.5rem;
    }
    
    .table-modern {
        font-size: 0.875rem;
    }
    
    .table-modern .table thead th,
    .table-modern .table tbody td {
        padding: 0.75rem 1rem;
    }
    
    .btn-modern {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
    }
    
    .nav-modern {
        flex-direction: column;
    }
    
    .nav-modern .nav-link {
        justify-content: flex-start;
    }
}

/* ===== LIGHT THEME — rely on global tokens; no OS-dark remaps ===== */
.card-modern,
.form-modern,
.table-modern,
.nav-modern {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .card-modern,
    .btn-modern,
    .nav-modern .nav-link,
    .form-modern .form-control {
        transition: none;
    }
    
    .loading-skeleton {
        animation: none;
    }
    
    .loading-spinner {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .card-modern {
        border-width: 2px;
    }
    
    .btn-modern {
        border-width: 3px;
    }
    
    .form-modern .form-control {
        border-width: 3px;
    }
}