/* ===================================================================
   QA1 Inspection System - Preline UI + Tailwind CSS Theme
   Date: 2026-02-04
   Purpose: Custom styles for Preline UI to match QA1 branding
   =================================================================== */

/* CSS Variables for QA1 Brand Colors */
:root {
    --qa-primary: #4CAF50;      /* Green (buttons, success) */
    --qa-secondary: #007bff;    /* Blue (dashboard, links) */
    --qa-background: #f4f6f8;   /* Light gray background */
    --qa-text-primary: #222;    /* Dark text */
    --qa-text-secondary: #666;  /* Gray text */
    --qa-border: #ddd;          /* Border gray */
}

/* Body Styling */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--qa-background);
    margin: 0;
    padding-top: 70px;
}

/* Main Container */
.container.body-content {
    background: white;
    padding: 15px;
    border-radius: 0;
    box-shadow: none;
    max-width: 100%;
    margin: 0;
}

/* Desktop Styles */
@media (min-width: 768px) {
    .container.body-content {
        padding: 30px;
        border-radius: 10px;
        box-shadow: 0 0 12px rgba(0,0,0,0.08);
        max-width: 900px;
        margin: 0 auto;
    }

    body {
        padding-top: 70px;
    }
}

/* Mobile Styles */
@media (max-width: 767px) {
    body {
        padding-top: 60px;
        background-color: white;
    }
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--qa-text-primary);
}

/* Buttons - Override Preline defaults with QA1 colors */
.btn,
input[type="submit"],
input[type="button"],
button:not(.navbar-toggle) {
    background-color: var(--qa-primary);
    border: none;
    color: white;
    padding: 12px 24px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    margin: 5px;
    transition: background-color 0.2s ease;
}

.btn:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
button:not(.navbar-toggle):hover {
    background-color: #45a049;
}

/* Dashboard/Secondary Buttons */
.btn.dashboard-btn,
.btn-secondary {
    background-color: var(--qa-secondary);
}

.btn.dashboard-btn:hover,
.btn-secondary:hover {
    background-color: #0056b3;
}

/* Form Labels */
label,
.field-label {
    font-weight: bold;
    margin-top: 15px;
    display: block;
    color: var(--qa-text-primary);
}

/* Form Inputs */
input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 10px;
    font-family: inherit;
    font-size: 14px;
    border: 1px solid var(--qa-border);
    border-radius: 4px;
    transition: border-color 0.2s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--qa-primary);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

/* Progress Bar */
.progress-bar-container {
    background-color: #e0e0e0;
    border-radius: 20px;
    height: 20px;
    overflow: hidden;
    margin-top: 10px;
}

#ProgressBar {
    background-color: var(--qa-primary);
    height: 100%;
    width: 0%;
    text-align: center;
    color: white;
    font-size: 12px;
    transition: width 0.4s ease;
}

/* Image Display */
.image-box img {
    max-width: 100%;
    max-height: 200px;
    border: 1px solid var(--qa-border);
    padding: 5px;
    border-radius: 5px;
    background: #fafafa;
}

/* Navigation Bar - Keep Bootstrap styling for consistency */
.navbar {
    background-color: #222;
    border-color: #080808;
}

.navbar-brand {
    color: #fff !important;
    font-weight: bold;
}

.navbar-nav > li > a {
    color: #fff !important;
}

.navbar-nav > li > a:hover {
    background-color: #444 !important;
}

/* GridView / Table Styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

table th {
    background-color: var(--qa-secondary);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 10px;
    border-bottom: 1px solid var(--qa-border);
}

table tr:hover {
    background-color: #f9f9f9;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
}

.badge.bg-success,
.badge-success {
    background-color: var(--qa-primary);
    color: white;
}

.badge.bg-danger,
.badge-danger {
    background-color: #f44336;
    color: white;
}

.badge.bg-warning,
.badge-warning {
    background-color: #ff9800;
    color: white;
}

.badge.bg-secondary,
.badge-secondary {
    background-color: var(--qa-border);
    color: var(--qa-text-primary);
}

/* Alerts */
.alert {
    padding: 12px;
    border-radius: 4px;
    margin: 15px 0;
}

.alert-success {
    background-color: #e8f5e8;
    border: 1px solid var(--qa-primary);
    color: #2e7d32;
}

.alert-danger {
    background-color: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
}

.alert-warning {
    background-color: #fff3e0;
    border: 1px solid #ff9800;
    color: #e65100;
}

.alert-info {
    background-color: #e3f2fd;
    border: 1px solid var(--qa-secondary);
    color: #01579b;
}

/* Footer */
footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--qa-border);
    color: var(--qa-text-secondary);
    text-align: center;
}

/* Mobile Responsive */
@media screen and (max-width: 600px) {
    .image-section {
        flex-direction: column;
    }

    .btn,
    input[type="submit"],
    input[type="button"] {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Text Utilities */
.text-muted {
    color: var(--qa-text-secondary);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

/* Spacing Utilities */
.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

/* Flexbox Utilities */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

/* Card/Panel Styling */
.panel,
.card {
    background: white;
    border: 1px solid var(--qa-border);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.panel-heading,
.card-header {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--qa-border);
}

/* Loading Spinner (for async operations) */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--qa-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Override Tailwind Preflight for ASP.NET Web Forms Compatibility */
input[type='button'],
input[type='submit'],
button {
    background-image: none;
}

/* Ensure form elements don't get Tailwind reset issues */
form {
    margin: 0;
}
