/* Register App - Service Agency Portal (Kerala) */
/* Main Styles */

:root {
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --secondary: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --dark: #1f2937;
    --light: #f3f4f6;
}

* { box-sizing: border-box; }

/* Increase base font size on PC to scale up all Tailwind elements (rem-based) globally */
@media (min-width: 1024px) {
    html {
        font-size: 17.5px;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-size: 16px;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1e3a5f 0%, #0d1b2a 100%);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.collapsed { transform: translateX(-280px); }

.main-content {
    margin-left: 280px;
    padding: 20px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-content.expanded { margin-left: 0; }

/* Menu Items */
.menu-item {
    padding: 14px 20px;
    color: #cbd5e1;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-size: 1.05rem;
}

.menu-item:hover, .menu-item.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left-color: #3b82f6;
}

.submenu {
    background: rgba(0,0,0,0.2);
    display: none;
}

.submenu.show { display: block; }

.submenu .menu-item {
    padding-left: 50px;
    font-size: 0.95rem;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    padding: 24px;
    margin-bottom: 20px;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4); transform: translateY(-1px); }
.btn-success { background: var(--secondary); color: white; }
.btn-success:hover { background: #047857; box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4); transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4); transform: translateY(-1px); }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #b45309; box-shadow: 0 4px 12px rgba(217, 119, 6, 0.4); transform: translateY(-1px); }

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #9ca3af;
    border-radius: 8px;
    font-size: 1rem !important;
    color: #111827;
    line-height: 1.5;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
}

/* Table Styles */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.95rem;
    color: #1f2937;
}

th {
    background: var(--dark);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

tr:hover { background: #f9fafb; }

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.show { display: flex; }

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Badge Styles */
.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success { background: #d1fae5; color: #047857; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-info { background: #dbeafe; color: #1d4ed8; }

/* Stats Card */
.stats-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 12px;
    padding: 20px;
}

/* Login Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

/* Loading Overlay */
.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.loading.show { display: flex; }

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tab Styles */
.tab-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 10px 20px;
    background: #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab.active {
    background: var(--primary);
    color: white;
}

/* Section Styles */
.section { display: none; }
.section.active { display: block; }

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 4000;
    animation: slideIn 0.3s ease;
}

.toast-success { background: var(--secondary); }
.toast-error { background: var(--danger); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-280px); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Action Buttons */
.action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    border: none;
    margin: 2px;
    transition: all 0.3s ease;
}

/* User Info in Sidebar */
.user-info {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 32px;
    color: white;
}

/* Conditional Fields */
.conditional-fields { display: none; }
.conditional-fields.show { display: block; }

/* Branch Logo */
.branch-logo {
    max-height: 50px;
    max-width: 150px;
    object-fit: contain;
}

.branch-header {
    padding: 10px 20px;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.branch-header img {
    max-height: 40px;
    max-width: 100px;
}

.branch-header span {
    color: #94a3b8;
    font-size: 14px;
}