/* Guardian Fire Inspection Demo - Styles */

:root {
    --primary-blue: #1e3a8a;
    --secondary-blue: #00B4D8;
    --accent-orange: #f97316;
    --dark-bg: #000000;
    --text-dark: #333333;
    --text-light: #475569;
    --border-color: #e2e8f0;
    --success-green: #10b981;
    --warning-yellow: #f59e0b;
    --danger-red: #dc2626;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: #f8fafc;
}

/* Demo Banner */
.demo-banner {
    background: linear-gradient(135deg, var(--accent-orange), #ea580c);
    color: white;
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.demo-banner i {
    margin-right: 0.5rem;
}

/* Header/Navigation */
header {
    background: var(--dark-bg);
    padding: 1rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
}

.logo-text span {
    color: var(--secondary-blue);
}

.logo-container {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 60px;
    width: auto;
}

@media (max-width: 768px) {
    .header-logo {
        height: 45px;
    }
}

@media (max-width: 480px) {
    .header-logo {
        height: 35px;
    }
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
}

nav a:hover,
nav a.active {
    background: var(--secondary-blue);
    color: white;
}

nav a i {
    font-size: 1rem;
}

/* Mobile Navigation */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: 2px solid white;
    color: white;
    font-size: 1.5rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 6px;
}

/* Medium screens - slightly smaller nav items */
@media (max-width: 1200px) {
    nav a {
        padding: 0.6rem 0.9rem;
        font-size: 0.85rem;
        gap: 0.4rem;
    }

    nav a i {
        font-size: 0.9rem;
    }
}

@media (max-width: 992px) {
    .mobile-menu-toggle {
        display: block;
    }

    nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--dark-bg);
        padding: 1rem;
        display: none;
        border-top: 2px solid var(--secondary-blue);
    }

    nav.active {
        display: block;
    }

    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    nav a {
        padding: 1rem;
        font-size: 1rem;
    }
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Page Title */
.page-title {
    color: var(--primary-blue);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.page-subtitle {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid var(--secondary-blue);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.stat-card.warning {
    border-left-color: var(--warning-yellow);
}

.stat-card.danger {
    border-left-color: var(--danger-red);
}

.stat-card.success {
    border-left-color: var(--success-green);
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.stat-value {
    color: var(--primary-blue);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.3;
    float: right;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.btn-primary:hover {
    background: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

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

.btn-secondary:hover {
    background: #0096B8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.3);
}

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

.btn-success:hover {
    background: #059669;
}

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

.btn-danger:hover {
    background: #b91c1c;
}

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

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

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
    min-height: 56px;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    min-height: auto;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Ensure table has minimum width on mobile */
}

@media (max-width: 768px) {
    table {
        min-width: 800px; /* Wider minimum on small screens to force scroll */
    }
}

thead {
    background: var(--primary-blue);
    color: white;
}

thead th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

tbody tr:hover {
    background: #f8fafc;
}

tbody tr[style*="cursor: pointer"]:hover {
    background: #e0f2fe;
    transform: scale(1.01);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

tbody tr[style*="cursor: pointer"] {
    transition: all 0.2s ease;
}

tbody td {
    padding: 1rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-scheduled {
    background: #dbeafe;
    color: #1e40af;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-pass {
    background: #d1fae5;
    color: #065f46;
}

.status-fail {
    background: #fee2e2;
    color: #991b1b;
}

.status-open {
    background: #fed7aa;
    color: #92400e;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-blue);
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Inspection Form */
.inspection-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.form-section-title {
    font-size: 1.25rem;
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
    flex: 1;
}

/* Signature Pad */
.signature-pad {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    cursor: crosshair;
    touch-action: none;
}

.signature-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Calendar */
.calendar {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-day {
    aspect-ratio: 1;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    font-size: 0.9rem;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-day:hover {
    background: #f8fafc;
    border-color: var(--secondary-blue);
}

.calendar-day.has-inspection {
    background: #dbeafe;
    border-color: var(--primary-blue);
}

.calendar-day.overdue {
    background: #fee2e2;
    border-color: var(--danger-red);
}

.calendar-day.today {
    background: #fef3c7;
    border-color: var(--warning-yellow);
    font-weight: 700;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    overflow-y: auto;
    padding: 2rem 1rem;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    color: var(--primary-blue);
    font-weight: 700;
}

.modal-close {
    background: var(--dark-bg);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--danger-red);
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.5rem;
}

/* Photo Upload */
.photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.photo-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--danger-red);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.85rem;
    }

    thead th,
    tbody td {
        padding: 0.75rem 0.5rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .form-section {
        padding: 1rem;
    }
}

/* Touch-Friendly Targets (minimum 48x48px) */
@media (max-width: 992px) {
    .btn {
        min-height: 48px;
        padding: 0.85rem 1.25rem;
    }

    .checkbox-group input[type="checkbox"] {
        width: 32px;
        height: 32px;
    }

    nav a {
        min-height: 48px;
    }
}

/* Mobile Inspection Cards */
.mobile-inspection-list {
    display: none;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.mobile-inspection-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.mobile-inspection-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.inspection-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.inspection-card-header h3 {
    color: var(--primary-blue);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.inspection-card-header p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

.inspection-card-body {
    margin-bottom: 1rem;
}

.inspection-card-body p {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.inspection-card-body i {
    color: var(--secondary-blue);
    width: 20px;
}

.inspection-card-footer {
    text-align: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.tap-to-view {
    color: var(--secondary-blue);
    font-size: 0.9rem;
    font-weight: 600;
}

.desktop-inspection-table {
    display: block;
}

/* Mobile/Tablet responsive behavior */
@media (max-width: 992px) {
    .mobile-inspection-list {
        display: grid;
    }

    .desktop-inspection-table {
        display: none;
    }
}

/* Footer Styles */
footer {
    background: #000000;
    color: white;
    padding: 2rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--secondary-blue);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section p {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-section a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--secondary-blue);
}

.footer-contact-item {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-contact-item i {
    color: var(--secondary-blue);
    margin-top: 0.25rem;
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 1.5rem;
    text-align: center;
}

.footer-bottom p {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.footer-logo-img {
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    footer {
        padding: 1.5rem 0 1rem;
        margin-top: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Print Styles */
@media print {
    header,
    nav,
    .demo-banner,
    .btn,
    footer {
        display: none !important;
    }

    .container {
        max-width: 100%;
    }
}
