@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #00205B;
    --secondary-color: #f4f4f4;
    --text-color: #333;
    --text-muted: #666;
    --bg-color: #f9f9f9;
    --card-bg: #ffffff;
    --border-color: #ddd;
    --input-bg: #ffffff;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --primary-color: #4a90e2;
    /* Lighter blue for dark mode visibility */
    --secondary-color: #2d2d2d;
    --text-color: #e0e0e0;
    --text-muted: #aaa;
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --border-color: #444;
    --input-bg: #2d2d2d;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 95%;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-logo {
    height: 40px;
    width: auto;
    border-radius: 4px;
    background-color: white;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

.nav-links a:hover {
    text-decoration: underline;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

.card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
    transition: background-color 0.3s ease;
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
    background-color: var(--input-bg);
    color: var(--text-color);
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    color: #666;
    font-weight: 500;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-btn.disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}

.next-btn-container {
    margin-top: 15px;
    text-align: center;
}

.next-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    width: 100%;
}

/* Grid */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Row and Column System */
.row {
    display: flex;
    flex-wrap: wrap;
}

.row.justify-content-center {
    justify-content: center;
}

.col-md-8 {
    flex: 0 0 100%;
    max-width: 100%;
    padding-right: 0;
    padding-left: 0;
}

/* Status */
.status-indicator {
    padding: 10px;
}

/* Listbox style for slots */
.slot-list {
    height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    padding: 5px;
}

.slot-item {
    padding: 5px;
    cursor: pointer;
}

.slot-item:hover {
    background-color: #f0f0f0;
}

.slot-item.selected {
    background-color: #e2e6ea;
    color: var(--primary-color);
    font-weight: bold;
}

/* Leader Item (Same style as Slot Item) */
.leader-item {
    padding: 5px;
    cursor: pointer;
}

.leader-item:hover {
    background-color: #f0f0f0;
}

.leader-item.selected {
    background-color: #e2e6ea;
    color: var(--primary-color);
    font-weight: bold;
}

/* Modal Premium Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: 0;
    padding: 0;
    border: none;
    width: 90%;
    max-width: 500px;
    /* Standard Width */
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);

    /* Centering */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    /* Height Control */
    max-height: 95vh;
    overflow-y: auto;

    animation: popIn 0.3s ease-out;
}

.modal-content.contact-modal {
    background-color: #fefefe;
    margin: 0;
    padding: 0;
    border: none;
    width: 90%;
    max-width: 450px;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), #003399);
    color: white;
    padding: 20px 25px;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.close {
    color: rgba(255, 255, 255, 0.8);
    font-size: 24px;
    font-weight: 300;
    transition: 0.2s;
}

.close:hover {
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.developer-profile {
    text-align: center;
}

.developer-profile h3 {
    color: var(--primary-color);
    margin: 0 0 5px 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.role-badge {
    display: inline-block;
    background: #eef2ff;
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 25px;
}

.contact-details {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    text-align: left;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-item .icon {
    font-size: 1.2rem;
    margin-right: 15px;
    min-width: 25px;
    text-align: center;
}

.contact-item a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.contact-item a:hover {
    color: var(--primary-color);
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #f0f0f0;
    text-align: right;
    background-color: #fff;
    /* border-radius handled by parent overflow: hidden */
}

.btn-secondary {
    background-color: #f1f3f5;
    color: #444;
    border: 1px solid transparent;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: #e9ecef;
}

/* Login Page Styles */
/* Login Page Styles */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    width: 100%;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    box-sizing: border-box;
    /* Clean reset */
    position: relative;
}

.login-container-split {
    display: flex;
    flex-direction: row !important;
    /* Force row */
    flex-wrap: nowrap !important;
    /* Force no wrap */
    width: 1100px;
    /* Increased from 900px to handle larger logo */
    max-width: 95%;
    /* Better mobile handling */
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12), 0 15px 30px rgba(0, 0, 0, 0.08);
    /* Deeper 3D Shadow */
    overflow: hidden;
    min-height: 550px;
    transition: transform 0.3s ease;
}

/* Left Panel - Branding (Now White with Subtle Gradient) */
.login-left {
    flex: 0 0 35%;
    /* Reduced to 35% */
    max-width: 35%;
    background: #ffffff;
    /* Pure white to blend JPG logo */
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Prevent flex overflow */
    justify-content: center;
    align-items: center;
    color: var(--primary-color);
    padding: 40px;
    overflow: hidden;
    border: none;
}

.brand-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.logo-box {
    background: transparent;
    padding: 0;
    border-radius: 0;
    display: inline-block;
    margin-bottom: 20px;
    box-shadow: none;
}

.crc-main-logo {
    max-width: 380px;
    /* Increased size significantly */
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    /* Centered */
    mix-blend-mode: multiply;
}



/* Decorative Circle */
.decor-circle {
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    top: -50px;
    left: -50px;
    z-index: 1;
}


/* Right Panel - Form (Now Gradient) */
/* Right Panel - Form (Now Gradient) */
.login-right {
    flex: 0 0 65%;
    /* Increased to 65% */
    max-width: 65%;
    padding: 40px;
    max-width: 350px;
}

.login-header {
    margin-bottom: 40px;
}

.login-right h1 {
    color: white;
    margin: 0 0 10px 0;
    font-size: 2rem;
    font-weight: 700;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin-bottom: 0;
}

.login-actions {
    margin-bottom: 40px;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    color: var(--text-color);
    border: none;
    border-radius: 12px;
    padding: 16px 20px;
    text-decoration: none;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    /* Lifted button */
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    /* Prevent text wrapping */
    transform: translateY(0);
}

.google-btn:hover {
    background-color: #ffffff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    /* Stronger lift on hover */
    transform: translateY(-3px);
}


.google-icon-wrapper {
    display: flex;
    align-items: center;
}

.google-icon-wrapper img {
    width: 22px;
    height: 22px;
    margin-right: 15px;
}

.login-footer {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-footer p {
    margin: 0;
}

.support-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0.9;
}

.support-link:hover {
    text-decoration: underline;
    opacity: 1;
}

/* Preview Table */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.preview-table th,
.preview-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.preview-table th {
    background-color: var(--secondary-color);
    font-weight: 600;
}

.preview-table tr:last-child td {
    border-bottom: none;
}

.preview-row.error {
    background-color: rgba(220, 53, 69, 0.1);
    /* Light Red */
}

.preview-row.success {
    background-color: rgba(40, 167, 69, 0.1);
    /* Light Green */
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-error {
    background: #f8d7da;
    color: #721c24;
}

@media (max-width: 600px) {
    .login-container-split {
        flex-direction: column;
        height: auto;
        width: 100%;
        margin: 20px 0;
    }

    .login-left {
        padding: 40px 20px;
        min-height: 250px;
    }

    .decor-circle {
        width: 200px;
        height: 200px;
    }

    .login-right {
        padding: 40px 20px;
    }

    .brand-content h2 {
        font-size: 1.8rem;
    }
}

.modal-content.modal-lg {
    width: 95%;
    max-width: 900px;
    /* Reduced from 1100px for better focus */
}

/* Premium Form Styles for Modal */
.modal-body .form-group label {
    font-size: 0.9rem;
    color: #555;
    font-weight: 600;
    margin-bottom: 6px;
}

.modal-body input[type="text"],
.modal-body textarea,
.modal-body select {
    background-color: #f8f9fa;
    border: 1px solid #e2e6ea;
    transition: all 0.2s ease;
    border-radius: 8px;
    /* Softer corners */
    padding: 10px 12px;
}

.modal-body input[type="text"]:focus,
.modal-body textarea:focus,
.modal-body select:focus {
    background-color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 32, 91, 0.1);
    outline: none;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--card-bg);
    color: var(--text-color);
    min-width: 300px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 5px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideInToast 0.3s ease-out;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--danger-color);
}

@keyframes slideInToast {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

/* Wizard Animations */
.wizard-step {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* History Dashboard */
.history-item {
    border-left: 3px solid var(--border-color);
    padding-left: 15px;
    margin-bottom: 15px;
    position: relative;
}

.history-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--border-color);
}

.history-item.success::before {
    background: var(--success-color);
    border-color: var(--success-color);
}

.history-item .date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.history-item .title {
    font-weight: 600;
    display: block;
}

.history-item .details {
    font-size: 0.9rem;
    color: var(--text-color);
}

/* Dark Mode Specific Fixes */
[data-theme="dark"] .modal-content {
    background-color: var(--card-bg);
    color: var(--text-color);
}

[data-theme="dark"] .login-container-split {
    background-color: var(--card-bg);
}

[data-theme="dark"] .login-left {
    background-color: var(--card-bg);
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

/* REDESIGNED RECENT ACTIVITY */
.activity-card {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
    transition: all 0.2s ease;
    border-left: none;
    /* Removed as per user request */
    /* Default border */
}

.activity-card.success {
    /* Removed border-left-color */
    background: #fcfdfd;
}

.activity-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.activity-title {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1rem;
}

.activity-time {
    font-size: 0.8rem;
    color: #888;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 12px;
}

.activity-details {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 8px;
}

.activity-meta {
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 10px;
}

.activity-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Utility Classes for Visibility */
.d-none { display: none !important; }
@media (min-width: 768px) {
    .d-md-flex { display: flex !important; }
    .d-md-none { display: none !important; }
}
@media (max-width: 767px) {
    .mobile-nav-visible { display: block !important; }
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}