/* Custom Vehicle Inspection System Styles */

/* Global Square Image Styling */
.square-image, 
.image-slot, 
.image-upload-slot, 
.captured-image {
    aspect-ratio: 1;
    object-fit: cover;
}

/* Ensure all inspection images maintain square aspect ratio */
.inspection-image,
.vehicle-image,
.assessment-image {
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
}

/* Brand Colors */
:root {
    --primary-color: #4f959b;
    --primary-dark: #3a7177;
    --primary-light: #6babb2;
    --text-color: #2b2b2b;
    --text-muted: #5a5a5a;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    
    /* Bootstrap Override */
    --bs-primary: #4f959b;
    --bs-primary-rgb: 79, 149, 155;
    --bs-success: #4f959b;
    --bs-success-rgb: 79, 149, 155;
    --bs-btn-active-bg: #4f959b;
    --bs-btn-active-border-color: #4f959b;
}

/* Ensure Bootstrap success buttons use our brand color */
.btn-success {
    background-color: #4f959b !important;
    border-color: #4f959b !important;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active {
    background-color: #3a7177 !important;
    border-color: #3a7177 !important;
}

/* Dashboard specific styles */
.dashboard-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 10px;
    margin-bottom: 2rem;
    padding: 2rem;
    text-align: center;
}

.dashboard-header h1 {
    font-weight: 700 !important;
    margin-bottom: 0.5rem;
    color: white !important;
}

.dashboard-header p {
    opacity: 0.9;
    margin-bottom: 0;
    font-size: 1.1rem;
    color: white;
}

/* Action cards */
.action-card {
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 100%;
    background: #f8f9fa;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 149, 155, 0.2);
    border-color: var(--primary-color);
}

.action-card .card-body {
    padding: 30px;
    text-align: center;
}

.action-card h5 {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-color);
    font-size: 1.3em;
}

.action-card p {
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Buttons */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 180px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    color: white;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* Small buttons for actions */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.875em;
    min-width: auto;
}

/* Traffic light status colors */
.bg-success {
    background-color: var(--success-color) !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
    color: var(--text-color) !important;
}

.bg-danger {
    background-color: var(--danger-color) !important;
}

/* Recent reports section */
.recent-reports {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 2rem;
    margin-top: 2rem;
}

.recent-reports h2 {
    color: #4f959b !important;
    font-weight: 600 !important;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.report-item {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.report-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
}

.report-info h6 {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.report-info small {
    color: var(--text-muted);
}

.report-status {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
}

/* Text colors */
.text-muted {
    color: var(--text-muted) !important;
}

body {
    color: var(--text-color);
}

/* Global heading styles - h1 white, h2-h6 primary color (except text-gradient) */
h1:not(.text-gradient) {
    font-weight: bold !important;
    color: white !important;
}

h2:not(.text-gradient), h3:not(.text-gradient), h4:not(.text-gradient), h5:not(.text-gradient), h6:not(.text-gradient) {
    font-weight: bold !important;
    color: #4f959b !important;
}

/* Specific heading overrides for consistency (exclude text-gradient as it sets its own weight) */
h1:not(.text-gradient) {
    font-weight: 700 !important;
}

h2:not(.text-gradient) {
    font-weight: 600 !important;
}

h3:not(.text-gradient), h4:not(.text-gradient), h5:not(.text-gradient), h6:not(.text-gradient) {
    font-weight: 600 !important;
}

/* Override for headings in card headers - keep them white */
.card-header h1, .card-header h2, .card-header h3, .card-header h4, .card-header h5, .card-header h6 {
    color: white !important;
}

/* Navbar styles */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand img {
    max-height: 100px;
    width: auto;
}

.navbar-brand span {
    color: var(--primary-color) !important;
    font-weight: 600;
}

.navbar-light .navbar-nav .nav-link {
    color: var(--primary-color) !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.navbar-light .navbar-nav .nav-link:hover {
    color: var(--primary-dark) !important;
    background-color: rgba(79, 149, 155, 0.1);
    border-radius: 5px;
}

.navbar-toggler {
    border-color: var(--primary-color);
}

.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%2879, 149, 155, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .dashboard-header h1 {
        font-size: 2rem;
    }

    .action-card .card-body {
        padding: 1.5rem;
    }

    .recent-reports {
        padding: 1.5rem;
        margin-top: 1.5rem;
    }

    .report-item {
        padding: 1rem;
    }
}

/* Tablet specific optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    .dashboard-header {
        padding: 2.5rem;
    }

    .action-card .card-body {
        padding: 2.5rem;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Utility classes */
.text-gradient {
    background: linear-gradient(45deg, #4f959b, #3a7177) !important;
    color: white !important; /* White text on gradient background */
    font-weight: bold !important; /* Ensure gradient headings are also bold */
    padding: 10px 20px; /* Add some padding around the text */
    border-radius: 5px; /* Rounded corners for the gradient bar */
    display: inline-block; /* Make background fit text width */
}

.shadow-custom {
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.1) !important;
}

/* Camera and image upload styles */
.image-upload-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

/* Specific image grid for vehicle areas - responsive layout */
.specific-image-grid {
    margin-bottom: 30px;
}

/* Remove old image-row and image-area styles since we're using Bootstrap grid */

.image-slot {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.area-label {
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    background: rgba(79, 149, 155, 0.9);
    color: white;
    font-size: 16px;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 3px;
    text-align: center;
    z-index: 2;
}

.image-slot:hover {
    border-color: var(--primary-color);
    background: rgba(79, 149, 155, 0.05);
}

.image-slot.has-image {
    border: 2px solid var(--primary-color);
    padding: 0;
}

.image-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.image-upload-slot {
    width: calc(16.666% - 12px);
    /* 6 per row with gaps */
    min-width: 150px;
    aspect-ratio: 1;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.image-upload-slot:hover {
    border-color: var(--primary-color);
    background: rgba(79, 149, 155, 0.05);
}

.image-upload-slot.has-image {
    border: 2px solid var(--primary-color);
    padding: 0;
}

.image-upload-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.upload-placeholder {
    text-align: center;
    color: #6c757d;
    padding: 20px;
}

.upload-placeholder i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 12px;
    cursor: pointer;
    z-index: 10;
}

/* Form sections */
.form-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.form-section h3 {
    color: #4f959b !important;
    font-weight: 600 !important;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.form-row {
    margin-bottom: 20px;
}

/* Image upload responsive adjustments */
@media (max-width: 1200px) {
    .image-upload-slot {
        width: calc(20% - 12px);
        /* 5 per row */
    }
}

@media (max-width: 992px) {
    .image-upload-slot {
        width: calc(25% - 12px);
        /* 4 per row */
    }
}

@media (max-width: 768px) {
    .image-upload-slot {
        width: calc(33.333% - 10px);
        /* 3 per row */
        min-width: 120px;
    }

    .form-section {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .image-upload-slot {
        width: calc(50% - 8px);
        /* 2 per row */
        min-width: 140px;
    }
}