/* Custom CSS for MyApartment Application */

:root {
    --primary-color: #4e73df;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --secondary-color: #858796;
    --light-color: #f8f9fc;
    --dark-color: #5a5c69;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fc;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container .card {
    border-radius: 15px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.login-container .card-title {
    font-weight: 700;
    color: var(--primary-color);
}

/* Dashboard Styles */
.border-left-primary {
    border-left: 0.25rem solid var(--primary-color) !important;
}

.border-left-success {
    border-left: 0.25rem solid var(--success-color) !important;
}

.border-left-info {
    border-left: 0.25rem solid var(--info-color) !important;
}

.border-left-warning {
    border-left: 0.25rem solid var(--warning-color) !important;
}

.border-left-danger {
    border-left: 0.25rem solid var(--danger-color) !important;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.card-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    border-radius: 10px 10px 0 0 !important;
}

/* Navigation Styles */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Button Styles */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Statistics Cards */
.text-xs {
    font-size: 0.7rem;
}

.font-weight-bold {
    font-weight: 700 !important;
}

.text-uppercase {
    text-transform: uppercase !important;
}

.text-gray-800 {
    color: #5a5c69 !important;
}

.text-gray-300 {
    color: #dddfeb !important;
}

/* Table Styles */
.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fc;
    border-bottom: 2px solid #e3e6f0;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* Badge Styles */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.5em 0.75em;
    border-radius: 6px;
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 10px;
    font-weight: 500;
}

/* Form Styles */
.form-control {
    border-radius: 8px;
    border: 1px solid #d1d3e2;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.form-label {
    font-weight: 600;
    color: #5a5c69;
    margin-bottom: 0.5rem;
}

/* Rule: Required field star styling */
.required-star {
    color: #dc3545;
    font-weight: 700;
}

/* Footer */
footer {
    margin-top: auto;
    border-top: 1px solid #e3e6f0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container .card {
        margin: 1rem;
    }
    
    .card-body {
        padding: 1.5rem !important;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Utilities */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow {
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15) !important;
}

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

/* Status Indicators */
.status-occupied {
    color: var(--success-color);
}

.status-available {
    color: var(--info-color);
}

.status-pending {
    color: var(--warning-color);
}

.status-completed {
    color: var(--success-color);
}

.status-in-progress {
    color: var(--info-color);
}

/* Icon Styles */
.fa-3x {
    font-size: 3em;
}

.fa-2x {
    font-size: 2em;
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Home page specific styles - moved from inline to avoid CSP issues */
.hero-content {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    padding: 1.5rem;
    min-height: calc(100vh - 70px - 40px - 2rem);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin: 1rem 0;
}

/* Home page access cards - fixed position, no hover effects */
.home-access-card {
    position: relative;
    transition: none !important;
    transform: none !important;
}

.home-access-card:hover {
    transform: none !important;
    transition: none !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-height: 70px;
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: white !important;
}

.navbar-toggler {
    border-color: rgba(255,255,255,0.3);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Logo transparency styles */
.logo-transparent {
    background: transparent !important;
    mix-blend-mode: multiply;
    filter: contrast(1.2) brightness(1.1);
    max-height: 5rem;
}

/* Feature items */
.feature-item {
    text-align: center;
    padding: 0.75rem;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    background-color: rgba(0,123,255,0.1);
}

.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15) !important;
}

/* Wizard shared layout */
.wizard-controls {
    margin-top: -1.6rem;
    margin-bottom: 0.2rem;
    align-items: center;
}

.wizard-controls .nav-pills .btn {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    line-height: 1.3;
}

.wizard-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-left: 0;
    margin-bottom: 0;
}

.wizard-actions {
    gap: 0.5rem;
}

.wizard-actions .btn {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    line-height: 1.3;
}

.wizard-card {
    min-height: 60vh;
    max-height: 60vh;
    transition: none !important;
    transform: none !important;
    box-shadow: none !important;
}

.wizard-card:hover {
    transform: none !important;
    box-shadow: none !important;
}

.wizard-card-body {
    min-height: 60vh;
    max-height: 60vh;
    transition: none !important;
    transform: none !important;
    box-shadow: none !important;
}

.wizard-card-body:hover {
    transform: none !important;
    box-shadow: none !important;
}

.wizard-card-body--scroll {
    overflow-y: auto;
}

.wizard-card-body--static {
    overflow-y: visible;
}

.wizard-panel {
    min-height: 50vh;
}

.wizard-subcard {
    background-color: #f8f9fb;
    border-radius: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    height: 100%;
}

.wizard-subcard-body {
    min-height: 46vh;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wizard-radio {
    gap: 0.4rem;
}

.wizard-radio .form-check-label {
    font-size: 0.85rem;
}

.wizard-section {
    min-height: calc(56vh - 2rem);
    font-size: 0.9rem;
}

.wizard-section--tight {
    font-size: 0.85rem;
}

.wizard-section-card {
    background-color: #f8f9fb;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 0.75rem;
    height: 100%;
}

.wizard-snapshot-table,
.snapshot-table {
    font-size: 0.8rem;
}

.wizard-snapshot-table th,
.wizard-snapshot-table td,
.snapshot-table th,
.snapshot-table td {
    text-align: left !important;
}

.wizard-snapshot-table tbody tr:nth-child(even),
.snapshot-table tbody tr:nth-child(even) {
    background-color: #eaf2ff !important;
}

.wizard-snapshot-head {
    border-bottom: 1px solid #e5e7eb;
}

.wizard-snapshot-body {
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
}

.wizard-btn-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wizard-detail-card {
    border-radius: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background-color: #ffffff;
}

.wizard-detail-card h6 {
    font-size: 0.85rem;
}

.wizard-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.5rem 1rem;
}

.wizard-detail-grid dt {
    font-size: 0.8rem;
    font-weight: 600;
    color: #5a5c69;
    margin-bottom: 0.25rem;
}

.wizard-detail-grid dd {
    font-size: 0.85rem;
    margin-bottom: 0;
    color: #333333;
}

.wizard-info-callout {
    background-color: #eef5ff;
    border: 1px solid rgba(13, 110, 253, 0.35);
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-size: 0.85rem;
}

.wizard-info-callout strong {
    font-size: 0.85rem;
}

.wizard-modal-card {
    position: relative;
    background-color: #f8f9fb;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 0.75rem;
    box-shadow: 0 0.35rem 0.85rem rgba(15, 23, 42, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.wizard-modal-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.wizard-modal-card-body {
    padding: 1.1rem 1.1rem 1.1rem;
    padding-top: 3.1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.82rem;
}

.wizard-modal-card-body::-webkit-scrollbar {
    width: 6px;
}

.wizard-modal-card-body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.6);
    border-radius: 3px;
}

.wizard-modal-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wizard-modal-tile {
    background-color: #ffffff;
    border-radius: 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.wizard-modal-headline {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    margin-bottom: 0.15rem;
}

.wizard-modal-text {
    font-size: 0.8rem;
    color: #1f2937;
    line-height: 1.35;
}

.wizard-modal-note {
    font-size: 0.74rem;
    color: #4b5563;
    line-height: 1.4;
}

.wizard-form-grid {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.55rem;
}

.wizard-form-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    margin-bottom: 0.2rem !important;
}

.wizard-form-note {
    font-size: 0.72rem;
    color: #4b5563;
}

.wizard-modal-actions {
    margin-top: auto;
    padding-top: 0.65rem;
    display: flex;
    gap: 0.5rem;
}

.wizard-modal-actions .btn {
    min-width: 110px;
}

.wizard-modal-wrapper {
    min-height: 19rem;
}


.wizard-info-callout {
    background-color: #eef5ff;
    border: 1px solid rgba(13, 110, 253, 0.35);
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-size: 0.85rem;
}

.wizard-info-callout strong {
    font-size: 0.85rem;
}

@media (max-width: 992px) {
    .wizard-card {
        min-height: auto;
        max-height: none;
    }

    .wizard-card-body {
        min-height: auto;
        max-height: none;
    }

    .wizard-section {
        min-height: auto;
    }
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Body font family */
body {
    font-family: 'Inter', sans-serif;
}

/* Dark theme styles */
[data-theme="dark"] {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
}

[data-theme="dark"] .hero-content {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .card {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
    border-color: #404040 !important;
}

[data-theme="dark"] .text-muted {
    color: #b0b0b0 !important;
}

[data-theme="dark"] .text-dark {
    color: #ffffff !important;
}

[data-theme="dark"] .navbar {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%) !important;
}

[data-theme="dark"] .footer-custom,
[data-theme="dark"] footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%) !important;
}

/* Global footer fixed height */
footer { 
    height: 40px; 
}

[data-theme="dark"] .table {
    color: #ffffff !important;
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > td,
[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > th {
    background-color: #2d2d2d !important;
}

[data-theme="dark"] .table-hover > tbody > tr:hover > td,
[data-theme="dark"] .table-hover > tbody > tr:hover > th {
    background-color: #404040 !important;
}

[data-theme="dark"] .form-control {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .form-select {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .form-control:focus {
    background-color: #2d2d2d !important;
    border-color: #667eea !important;
    color: #ffffff !important;
}

/* Dark theme overrides for commonly used utility classes */
[data-theme="dark"] .bg-light {
    background-color: #3a3a3a !important;
    color: #ffffff !important;
}

[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-body {
    background-color: #1f1f1f !important;
    color: #ffffff !important;
}

[data-theme="dark"] .bg-secondary-subtle {
    background-color: #2e2e2e !important;
    color: #ffffff !important;
}

[data-theme="dark"] .badge.bg-light {
    background-color: #3a3a3a !important;
    color: #ffffff !important;
    border-color: #555555 !important;
}

/* Preserve intended dark text on attention backgrounds in dark mode */
[data-theme="dark"] .bg-warning.text-dark,
[data-theme="dark"] .badge.bg-warning.text-dark {
    color: #1a1a1a !important;
}

[data-theme="dark"] .bg-info.text-dark,
[data-theme="dark"] .badge.bg-info.text-dark {
    color: #1a1a1a !important;
}

/* Improve outline-dark buttons visibility in dark mode */
[data-theme="dark"] .btn-outline-dark {
    color: #ffffff !important;
    border-color: #888888 !important;
}

[data-theme="dark"] .btn-outline-dark:hover,
[data-theme="dark"] .btn-outline-dark:focus {
    background-color: #444444 !important;
    border-color: #aaaaaa !important;
}

/* Card sections */
[data-theme="dark"] .card-header,
[data-theme="dark"] .card-footer {
    background-color: #262626 !important;
    color: #ffffff !important;
    border-color: #404040 !important;
}

[data-theme="dark"] .card-body {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
}

/* Lists and dropdowns */
[data-theme="dark"] .list-group-item {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
    border-color: #404040 !important;
}

[data-theme="dark"] .dropdown-menu {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
    border-color: #404040 !important;
}

[data-theme="dark"] .dropdown-item {
    color: #ffffff !important;
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: #3a3a3a !important;
    color: #ffffff !important;
}

/* Modals / popups */
[data-theme="dark"] .modal-content {
    background-color: #2a2a2a !important;
    color: #ffffff !important;
    border-color: #404040 !important;
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: #404040 !important;
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(120%);
}

/* Toasts */
[data-theme="dark"] .toast {
    background-color: #2a2a2a !important;
    color: #ffffff !important;
    border-color: #404040 !important;
}

[data-theme="dark"] .toast-header {
    background-color: #333333 !important;
    color: #ffffff !important;
    border-bottom-color: #404040 !important;
}

/* Input group */
[data-theme="dark"] .input-group-text {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
    color: #ffffff !important;
}

/* Nav tabs/pills */
[data-theme="dark"] .nav-tabs .nav-link {
    color: #cccccc !important;
    border-color: #404040 !important;
}

[data-theme="dark"] .nav-tabs .nav-link.active,
[data-theme="dark"] .nav-tabs .nav-link:focus,
[data-theme="dark"] .nav-tabs .nav-link:hover {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
    border-color: #666666 #666666 #2d2d2d !important;
}

/* Add Complex Form Styles */
.add-complex-form {
    font-size: 0.85rem;
}

.add-complex-title {
    font-size: 0.9rem;
}

[data-theme="dark"] .add-complex-form .card-header {
    background-color: #2d2d2d !important;
    border-bottom-color: #404040 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .add-complex-form .card-body {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
}

[data-theme="dark"] .add-complex-form .form-label {
    color: #ffffff !important;
}

.add-complex-label {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.add-complex-btn {
    font-size: 0.8rem;
}

/* Enhanced border-left styles for statistics cards */
.border-left-primary {
    border-left: 4px solid #007bff !important;
}

.border-left-secondary {
    border-left: 4px solid #6c757d !important;
}

.border-left-success {
    border-left: 4px solid #28a745 !important;
}

.border-left-info {
    border-left: 4px solid #17a2b8 !important;
}

.border-left-warning {
    border-left: 4px solid #ffc107 !important;
}

.border-left-danger {
    border-left: 4px solid #dc3545 !important;
}

/* Custom action card padding for better alignment */
.action-card-body {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
}

/* Custom recent activities card padding */
.recent-activities-body {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

/* Theme toggle button consistency */
#darkThemeToggle {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 0.3s ease !important;
}

#darkThemeToggle:hover {
    transform: scale(1.1) !important;
}

#darkThemeToggle i {
    font-size: 16px !important;
    line-height: 1 !important;
}
