/* ===================================
   MBA Paglaum - Modern Design System
   Insurance Management Theme
   ================================== */

/* ============= ROOT VARIABLES ============= */
:root {
    /* Primary Colors - Deep Navy Blue Theme */
    --primary: #000199;
    --primary-dark: #000066;
    --primary-light: #0001cc;
    --primary-gradient: linear-gradient(135deg, #000199 0%, #0001cc 100%);
    
    /* Secondary Colors */
    --secondary: #4d4dff;
    --accent: #6b6bff;
    
    /* Status Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============= GLOBAL RESETS ============= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    font-size: 16px;
}

/* ============= CONTAINER ============= */
.site-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============= HEADER ============= */
.site-header {
    background: var(--primary-gradient);
    color: white;
    padding: var(--space-xl) var(--space-lg);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.site-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.025em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* ============= NAVIGATION ============= */
.main-navigation {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-top: var(--space-md);
}

.main-navigation a {
    padding: var(--space-sm) var(--space-lg);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.main-navigation a:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.main-navigation a.active {
    background: white;
    color: var(--primary);
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============= CARDS ============= */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    margin: var(--space-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--gray-200);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-lg);
}

/* ============= BUTTONS ============= */
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-warning {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-200);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

/* ============= FORMS ============= */
.insurance-form {
    max-width: 900px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    transition: var(--transition);
    background: white;
    color: var(--gray-800);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[readonly] {
    background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%);
    cursor: not-allowed;
    color: var(--primary-dark);
    font-weight: 700;
    border-color: var(--primary-light);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.form-group small {
    display: block;
    margin-top: var(--space-xs);
    color: var(--gray-500);
    font-size: 0.8125rem;
}

.form-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--gray-200);
}

/* ============= TABLES ============= */
/* Excel-style Table */
table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: var(--space-lg) !important;
    background: white !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-size: 13px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    border-radius: 0 !important;
    overflow: visible !important;
}

table thead {
    background: #f8f9fa !important;
    color: #000000 !important;
    border-bottom: 2px solid #dee2e6 !important;
}

table th {
    padding: 10px 12px !important;
    text-align: left !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border: 1px solid #dee2e6 !important;
    background: #f8f9fa !important;
    color: #000000 !important;
    white-space: nowrap !important;
}

table td {
    padding: 8px 12px !important;
    border: 1px solid #dee2e6 !important;
    font-size: 13px !important;
    background: white !important;
    vertical-align: middle !important;
}

table tbody tr {
    transition: background-color 0.15s ease !important;
    border-bottom: none !important;
    transform: none !important;
}

table tbody tr:hover {
    background: #f1f3f5 !important;
    transform: none !important;
}

table tbody tr:nth-child(even) {
    background: #fafbfc !important;
}

table tbody tr:nth-child(even):hover {
    background: #f1f3f5 !important;
}

/* ============= ACTION LINKS ============= */
.action-links {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    justify-content: flex-start;
}

.action-link {
    padding: 4px 8px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    border: 1px solid transparent;
}

.action-link-view {
    background: #000199;
    color: white;
    border-color: #000199;
}

.action-link-view:hover {
    background: #000166;
    opacity: 0.9;
}

.action-link-edit {
    background: #198754;
    color: white;
    border-color: #198754;
}

.action-link-edit:hover {
    background: #157347;
    opacity: 0.9;
}

.action-link-delete {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.action-link-delete:hover {
    background: #bb2d3b;
    opacity: 0.9;
}

/* ============= BADGES ============= */
.badge,
.status-badge {
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
}

/* ============= MESSAGES ============= */
.message {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    border-left: 4px solid;
    box-shadow: var(--shadow);
}

.message-success {
    background: var(--success-light);
    color: #047857;
    border-color: var(--success);
}

.message-error {
    background: var(--danger-light);
    color: #b91c1c;
    border-color: var(--danger);
}

.message-warning {
    background: var(--warning-light);
    color: #92400e;
    border-color: var(--warning);
}

.message-info {
    background: var(--info-light);
    color: #1e40af;
    border-color: var(--info);
}

/* ============= EMPTY STATE ============= */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: var(--space-sm);
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: var(--space-lg);
}

/* ============= SEARCH & FILTERS ============= */
.search-form {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.search-form input,
.search-form select {
    flex: 1;
    min-width: 200px;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    transition: var(--transition);
}

.search-form input:focus,
.search-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-form button {
    padding: 0.875rem 1.5rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.search-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* ============= DASHBOARD STATS ============= */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin: var(--space-lg);
}

.stat-card {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: var(--space-xs);
}

.stat-card p {
    color: var(--gray-600);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
}

/* ============= QUICK ACTIONS ============= */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.quick-action-btn {
    padding: var(--space-xl);
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.quick-action-btn:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

/* ============= PAGINATION ============= */
.pagination {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    margin-top: var(--space-xl);
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 0.75rem 1rem;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 600;
    transition: var(--transition);
    font-size: 0.875rem;
}

.pagination a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.pagination .current {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

/* ============= FOOTER ============= */
.site-footer {
    background: #ffffff;
    color: #6c757d;
    padding: 30px 20px;
    text-align: center;
    margin-top: 40px;
    font-size: 13px;
    border-top: 1px solid #dee2e6;
}

.site-footer p {
    margin: 0;
    font-weight: 400;
    line-height: 1.6;
}

/* ============= UTILITIES ============= */
.text-center {
    text-align: center;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mt-5 { margin-top: var(--space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }
.mb-5 { margin-bottom: var(--space-xl); }

.fw-bold { font-weight: 700; }
.fw-normal { font-weight: 400; }

/* ============= RESPONSIVE ============= */

/* Mobile First - Base styles for mobile */
.site-container {
    padding: 0;
    margin: 0;
}

/* Tablet and below (768px) */
@media (max-width: 768px) {
    /* Header adjustments */
    .site-header {
        padding: var(--space-lg) var(--space-md);
    }
    
    .site-header h1 {
        font-size: 1.5rem;
    }
    
    /* Navigation - Mobile menu styles controlled by mobile-responsive.css */
    
    /* Cards */
    .card {
        padding: var(--space-lg);
        margin: var(--space-sm);
        border-radius: var(--radius);
    }
    
    .card h2 {
        font-size: 1.25rem;
    }
    
    /* Tables - enable horizontal scroll */
    table {
        font-size: 0.75rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    table thead,
    table tbody,
    table tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
    
    table th,
    table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
    }
    
    /* Forms */
    .insurance-form {
        padding: 0;
    }
    
    .form-group label {
        font-size: 0.8125rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 1rem; /* Prevent iOS zoom on focus */
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    /* Buttons */
    .btn-primary,
    .btn-secondary,
    .btn-success,
    .btn-danger,
    .btn-warning {
        padding: 0.875rem 1.25rem;
        font-size: 0.875rem;
        width: 100%;
        justify-content: center;
    }
    
    /* Action links */
    .action-links {
        gap: 0.25rem;
        justify-content: flex-start;
    }
    
    .action-link {
        font-size: 0.6875rem;
        padding: 0.375rem 0.625rem;
    }
    
    /* Stats cards */
    .stat-cards {
        grid-template-columns: 1fr;
        gap: var(--space-md);
        margin: var(--space-md);
    }
    
    .stat-card {
        padding: var(--space-lg);
    }
    
    .stat-card h3 {
        font-size: 2rem;
    }
    
    /* Quick actions */
    .quick-actions {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    /* Search form */
    .search-form {
        flex-direction: column;
    }
    
    .search-form input,
    .search-form select {
        min-width: 100%;
    }
    
    .search-form button {
        width: 100%;
    }
    
    /* Grid layouts - force single column */
    [style*="display: grid"][style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Pagination */
    .pagination {
        gap: 0.25rem;
        font-size: 0.75rem;
    }
    
    .pagination a,
    .pagination span {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    .site-header h1 {
        font-size: 1.25rem;
    }
    
    .main-navigation a {
        font-size: 0.8125rem;
        padding: 0.75rem 1rem;
    }
    
    .card {
        padding: var(--space-md);
        margin: var(--space-xs);
    }
    
    .card h2 {
        font-size: 1.125rem;
    }
    
    table th,
    table td {
        padding: 0.5rem 0.375rem;
        font-size: 0.6875rem;
    }
    
    .stat-card h3 {
        font-size: 1.75rem;
    }
    
    .stat-card p {
        font-size: 0.75rem;
    }
    
    .action-link {
        font-size: 0.625rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Tablet landscape (768px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .main-navigation a {
        font-size: 0.8125rem;
        padding: var(--space-sm) var(--space-md);
    }
    
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    table {
        font-size: 0.8125rem;
    }
}

/* Large screens (1440px and above) */
@media (min-width: 1440px) {
    .site-container {
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .stat-cards {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .quick-actions {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets for mobile */
    .btn-primary,
    .btn-secondary,
    button,
    .action-link,
    .main-navigation a {
        min-height: 44px; /* iOS recommended touch target */
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .card:hover,
    .stat-card:hover,
    table tbody tr:hover {
        transform: none;
    }
    
    /* Disable animations on touch devices for performance */
    * {
        animation-duration: 0.01s !important;
        transition-duration: 0.01s !important;
    }
}

/* Print styles */
@media print {
    .main-navigation,
    .action-links,
    .form-actions,
    .site-footer,
    .btn-primary,
    .btn-secondary {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
        page-break-inside: avoid;
    }
    
    table {
        page-break-inside: auto;
    }
    
    table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
}

/* ============= ANIMATIONS ============= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

.main-navigation a {
    animation: slideIn 0.3s ease-out backwards;
}

.main-navigation a:nth-child(1) { animation-delay: 0.05s; }
.main-navigation a:nth-child(2) { animation-delay: 0.1s; }
.main-navigation a:nth-child(3) { animation-delay: 0.15s; }
.main-navigation a:nth-child(4) { animation-delay: 0.2s; }
.main-navigation a:nth-child(5) { animation-delay: 0.25s; }
.main-navigation a:nth-child(6) { animation-delay: 0.3s; }

/* ============= SCROLL BAR ============= */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}
