/* HMC Landscape Manager - Custom Styles */
/* Hyundai Motor Company Branding */

/* Hide all developer console elements */
* {
    /* Hide any console-related elements */
}

[class*="Console"], 
[class*="console"], 
[class*="DevTools"],
[class*="devtools"],
[data-testid*="console"], 
[id*="console"],
[id*="Console"],
.replit-ui-theme-root [class*="Console"],
div[style*="bottom: 0px"],
div[style*="bottom:0px"],
div[style*="bottom: 0"],
div[style*="bottom:0"],
[style*="position: fixed"][style*="bottom"],
[class*="bottom-panel"],
[class*="BottomPanel"],
[class*="bottom-bar"],
[class*="BottomBar"] { 
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    overflow: hidden !important;
    font-size: 10px !important;
    opacity: 0.3 !important;
    transform: scale(0.8) !important;
    transform-origin: bottom left !important;
}

/* Ensure full viewport usage */
html, body {
    height: 100vh !important;
    width: 100vw !important;
    overflow-x: hidden !important;
}

/* Force hide bottom sections */
body > div:last-child,
body > div[style*="bottom"],
iframe + div,
main + div {
    display: none !important;
}

:root {
    --hmc-blue: #002C5F;
    --hmc-blue-light: #4A90E2;
    --hmc-blue-dark: #001a3d;
    --hmc-accent: #E6F3FF;
    --hmc-gray: #f8f9fa;
    --hmc-border: #dee2e6;
}

/* Building Structure Styles */
.floor-button-mini:hover {
    background-color: #C8DCE6 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.floor-button-mini.east:hover {
    background-color: #D4EDDA !important;
}

.atrium-section-mini:hover {
    background-color: #FFF4CD !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.basement-section:hover {
    background-color: #98FB98 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--hmc-gray);
    color: #333;
    font-size: 16px;
    line-height: 1.5;
}

/* Better text rendering for mobile */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure minimum text sizes for mobile */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.2rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p, div, span, a {
    font-size: 1rem;
    line-height: 1.5;
}

.btn {
    font-size: 1rem;
    font-weight: 500;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.card-text {
    font-size: 1rem;
    line-height: 1.5;
}

/* Hyundai Blue Theme */
.bg-hmc-blue {
    background-color: var(--hmc-blue) !important;
}

.text-hmc-blue {
    color: var(--hmc-blue) !important;
}

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

.btn-hmc-blue:hover {
    background-color: var(--hmc-blue-dark);
    border-color: var(--hmc-blue-dark);
    color: white;
}

.btn-outline-hmc-blue {
    color: var(--hmc-blue);
    border-color: var(--hmc-blue);
}

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

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

/* Mobile responsive navbar brand */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
        line-height: 1.2;
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
        max-width: 100%;
    }
    
    .navbar-brand i {
        font-size: 0.9rem;
        margin-right: 0.3rem !important;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 0.85rem;
        max-width: 100%;
        font-weight: 600;
    }
    
    .navbar-brand i {
        font-size: 0.75rem;
        margin-right: 0.25rem !important;
    }
}

/* Extra small screens */
@media (max-width: 400px) {
    .navbar-brand {
        font-size: 0.8rem;
    }
    
    .navbar-brand i {
        font-size: 0.7rem;
        margin-right: 0.2rem !important;
    }
}

.content-with-navbar {
    padding-top: 76px; /* Account for fixed navbar */
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--hmc-blue) 0%, var(--hmc-blue-light) 100%);
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 44, 95, 0.1);
    border: none;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--hmc-blue), var(--hmc-blue-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 2rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    border-bottom: 1px solid var(--hmc-border);
    border-radius: 12px 12px 0 0 !important;
}

/* Statistics Cards */
.stat-card {
    transition: all 0.3s ease;
    border-radius: 16px;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 44, 95, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.5rem;
}

/* Clickable card hover effect */
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 44, 95, 0.15);
    transition: all 0.3s ease;
}

/* Building Navigator Styles - Force Visibility */
.building-navigator-mini {
    min-height: 400px !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    display: block !important;
}

.building-section-mini {
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
    position: absolute !important;
}

.floor-button-mini:hover {
    background: rgba(0, 44, 95, 1.0) !important;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

.atrium-section-mini:hover {
    transform: scale(1.05);
    transition: all 0.2s ease;
}

.basement-section:hover {
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    /* Navbar brand text adjustment */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    /* Card spacing */
    .card {
        margin-bottom: 1rem;
    }
    
    /* Button groups */
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-group-mobile .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Modal adjustments */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    /* Table responsiveness */
    .table-responsive {
        border: none;
    }
    
    /* Form controls */
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px;
        padding: 0.75rem;
    }
    
    /* Label text size */
    .form-label, label {
        font-size: 1rem;
        font-weight: 500;
        margin-bottom: 0.5rem;
    }
    
    /* Help text */
    .form-text, .text-muted {
        font-size: 0.95rem;
    }
    
    /* Badge text */
    .badge {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Table text */
    .table td, .table th {
        font-size: 1rem;
        padding: 0.75rem;
    }
    
    /* Dropdown text */
    .dropdown-item {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
    
    /* Modal text */
    .modal-title {
        font-size: 1.3rem;
    }
    
    .modal-body {
        font-size: 1rem;
    }
    
    /* Alert text */
    .alert {
        font-size: 1rem;
        padding: 1rem;
    }
    
    /* Navigation links */
    .nav-link {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
    
    /* Breadcrumb text */
    .breadcrumb-item {
        font-size: 1rem;
    }
    
    /* Card text improvements */
    .card-body {
        font-size: 1rem;
    }
    
    .card-footer {
        font-size: 0.95rem;
    }
    
    /* Task cards mobile layout */
    .task-card {
        margin-bottom: 1rem;
    }
    
    .task-card .card-footer .d-md-flex {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .task-card .btn {
        width: 100%;
    }
    
    /* Plant detail mobile layout */
    .plant-detail-header {
        text-align: center;
        margin-bottom: 2rem;
    }
    
    .plant-detail-header h1 {
        font-size: 1.5rem;
    }
    
    .plant-detail-header h2 {
        font-size: 1.25rem;
    }
    
    /* Image grid mobile */
    .plant-images .col-6 {
        margin-bottom: 1rem;
    }
    
    /* Record form mobile */
    .record-form-mobile .col-md-6,
    .record-form-mobile .col-md-4 {
        margin-bottom: 1rem;
    }
    
    /* QR Scanner mobile */
    #qr-scanner {
        border-radius: 12px;
        overflow: hidden;
    }
    
    #qr-video {
        width: 100%;
        height: auto;
        max-height: 300px;
        object-fit: cover;
    }
    
    /* Touch targets */
    .btn {
        min-height: 44px; /* iOS touch target */
        padding: 0.75rem 1rem;
    }
    
    .btn-sm {
        min-height: 38px;
        padding: 0.5rem 0.75rem;
    }
    
    /* Navigation mobile */
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
    
    /* Alert adjustments */
    .alert {
        border-radius: 8px;
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    /* Extra small screens */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Card padding */
    .card-body {
        padding: 1rem;
        font-size: 1rem; /* Ensure readable text */
    }
    
    /* Form spacing */
    .mb-3 {
        margin-bottom: 1rem !important;
    }
    
    .mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    /* Button text size - keep readable */
    .btn {
        font-size: 1rem;
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
    
    /* Text improvements for small screens */
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.3rem; }
    h4 { font-size: 1.2rem; }
    h5 { font-size: 1.1rem; }
    
    .card-title {
        font-size: 1.2rem;
    }
    
    .navbar-brand {
        font-size: 0.9rem;
        max-width: 100%;
    }
    
    /* Ensure nav links are readable */
    .nav-link {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
    
    /* Form controls stay readable */
    .form-control, .form-select {
        font-size: 16px;
        min-height: 44px;
    }
    
    /* Table improvements */
    .table td, .table th {
        font-size: 0.95rem;
        padding: 0.6rem;
    }
    
    /* Plant images small screen */
    .plant-images .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    .plant-images .card-body {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    .plant-images img {
        height: 150px !important;
    }
}

.card-hover {
    transition: all 0.3s ease;
}

/* Task Cards */
.task-card {
    transition: all 0.3s ease;
    border-radius: 12px;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 44, 95, 0.1);
}

.task-completed {
    background-color: var(--hmc-accent);
    border-left: 4px solid #28a745;
}

/* Keymap Styles */
.keymap-container {
    position: relative;
    max-width: 100%;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid var(--hmc-border);
}

.keymap-image {
    width: 100%;
    height: auto;
    display: block;
    cursor: crosshair;
}

.plant-pin {
    position: absolute;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    margin-top: -20px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.plant-pin:hover {
    transform: scale(1.2);
}

.plant-pin i {
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Form Enhancements */
.form-control:focus {
    border-color: var(--hmc-blue-light);
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
}

.form-select:focus {
    border-color: var(--hmc-blue-light);
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
}

/* Tables */
.table th {
    border-top: none;
    font-weight: 600;
    color: var(--hmc-blue);
    background-color: var(--hmc-accent);
}

.table-hover tbody tr:hover {
    background-color: var(--hmc-accent);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.alert-info {
    background-color: var(--hmc-accent);
    border-left-color: var(--hmc-blue);
    color: var(--hmc-blue-dark);
}

/* Breadcrumbs */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: var(--hmc-blue);
}

/* QR Scanner Styles */
#qr-scanner {
    max-width: 400px;
    margin: 0 auto;
}

#qr-video {
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Plant Detail Styles */
.plant-detail-image {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Record Form Styles */
.record-form-section {
    padding: 1.5rem;
    background-color: white;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--hmc-blue);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .content-with-navbar {
        padding-top: 66px;
    }
    
    .login-card {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .task-card {
        margin-bottom: 1rem;
    }
    
    .keymap-container {
        margin-bottom: 1rem;
    }
    
    .plant-pin {
        width: 24px;
        height: 24px;
        margin-left: -12px;
        margin-top: -24px;
    }
    
    .plant-pin i {
        font-size: 24px;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .card-title {
        font-size: 1.8rem;
    }
}

/* Loading Animations */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .alert {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000;
        break-inside: avoid;
    }
    
    .content-with-navbar {
        padding-top: 0;
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for better accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--hmc-blue);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --hmc-blue: #000080;
        --hmc-border: #000000;
    }
    
    .card {
        border: 2px solid #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .stat-card,
    .task-card,
    .plant-pin {
        transition: none;
    }
    
    .loading-spinner {
        animation: none;
    }
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles would go here */
}
