/* ===================================
   CSS Variables - Professional Dark Blue
   =================================== */
:root {
    --primary: #003399;
    --primary-hover: #002266;
    --primary-light: #0044bb;
    --secondary: #666666;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    
    --bg-main: #f5f5f5;
    --bg-white: #ffffff;
    --bg-gray-light: #f8f9fa;
    --bg-gray: #e9ecef;
    --bg-dark: #333333;
    
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    
    --border-color: #cccccc;
    --border-light: #e0e0e0;
    --border-dark: #999999;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.12);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
}

/* ===================================
   Base Styles
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-main);
    min-height: 100vh;
    font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
}

/* ===================================
   Progress Bar
   =================================== */
.progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--bg-gray);
    z-index: 9999;
    box-shadow: var(--shadow-sm);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 0.4s ease;
    box-shadow: 0 0 8px rgba(0, 51, 153, 0.3);
}

.progress-bar-fill.step-1 { width: 33.33%; }
.progress-bar-fill.step-2 { width: 66.66%; }
.progress-bar-fill.step-3 { width: 100%; }

/* ===================================
   Header
   =================================== */
.app-header {
    background: var(--bg-white);
    border-bottom: 2px solid var(--primary);
    padding: 16px 24px;
    box-shadow: var(--shadow-md);
    position: fixed;
    top: 4px;
    left: 0;
    right: 0;
    z-index: 1000;
}

.app-logo {
    height: 36px;
    width: auto;
}

.header-divider {
    width: 2px;
    height: 40px;
    background: var(--border-color);
}

.app-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.app-subtitle {
    font-size: 9px;
    color: var(--text-secondary);
    margin: 0;
}

.brand-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
}

/* ===================================
   Main Container
   =================================== */
.main-container {
    max-width: 1200px;
    margin: 100px auto 40px;
    background: var(--bg-white);
    border-radius: 4px;
    padding: 40px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

/* ===================================
   Typography
   =================================== */
h2, h3, h4 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 16px;
}

h2 { 
    font-size: 28px;
    line-height: 1.3;
    color: var(--primary);
}

h3 { 
    font-size: 22px;
    line-height: 1.4;
    color: var(--text-primary);
}

h4 {
    font-size: 18px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted) !important;
    font-size: 14px;
}

/* ===================================
   Form Elements
   =================================== */
.form-label {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
    display: block;
}

.form-control, 
.form-select {
    border: 2px solid var(--border-color);
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: var(--bg-white);
    color: var(--text-primary);
    font-family: inherit;
}

.form-control:focus, 
.form-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.1);
}

.form-control:hover:not(:focus),
.form-select:hover:not(:focus) {
    border-color: var(--border-dark);
}

.form-check-input {
    border: 2px solid var(--border-color);
    border-radius: 3px;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-label {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

/* ===================================
   Buttons
   =================================== */
.btn-custom {
    background: var(--primary);
    border: 2px solid var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-custom:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(0, 51, 153, 0.3);
    transform: translateY(-1px);
}

.btn-custom:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--bg-white);
    border: 2px solid var(--border-dark);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--bg-gray);
    border-color: var(--text-secondary);
}

.btn-success {
    background: var(--success);
    border: 2px solid var(--success);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-success:hover {
    background: #218838;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* ===================================
   Photo Container & Zoom
   =================================== */
.photo-container {
    position: relative;
    width: 100%;
    margin: 24px 0;
    display: none;
}

.photo-zoom-wrapper {
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: 4px;
    border: 3px solid var(--primary);
    cursor: move;
    position: relative;
    background: #f0f0f0;
}

.photo-zoom-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s;
    transform-origin: center center;
}

.zoom-controls {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: var(--bg-white);
    padding: 6px;
    border-radius: 4px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border-color);
    z-index: 10;
    display: flex;
    gap: 6px;
}

.zoom-controls button {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-controls button:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ===================================
   Arrows
   =================================== */
.arrow {
    position: absolute;
    font-size: 36px;
    cursor: pointer;
    color: var(--primary);
    transition: all 0.2s;
    z-index: 5;
    opacity: 0.9;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.arrow:hover {
    opacity: 1;
    transform: scale(1.15);
    color: var(--primary-light);
    filter: drop-shadow(0 4px 8px rgba(0, 51, 153, 0.4));
}

.arrow-left-top, 
.arrow-left-center, 
.arrow-left-bottom { left: 12px; }

.arrow-right-top, 
.arrow-right-center, 
.arrow-right-bottom { right: 12px; }

.arrow-top-left, 
.arrow-top-center, 
.arrow-top-right { top: 12px; }

.arrow-bottom-left, 
.arrow-bottom-center, 
.arrow-bottom-right { bottom: 12px; }

.arrow-left-top, 
.arrow-right-top { top: 12px; }

.arrow-left-bottom, 
.arrow-right-bottom { bottom: 12px; }

.arrow-left-center, 
.arrow-right-center {
    top: 50%;
    transform: translateY(-50%);
}

.arrow-left-center:hover, 
.arrow-right-center:hover {
    transform: translateY(-50%) scale(1.1);
}

.arrow-top-center, 
.arrow-bottom-center {
    left: 50%;
    transform: translateX(-50%);
}

.arrow-top-center:hover, 
.arrow-bottom-center:hover {
    transform: translateX(-50%) scale(1.1);
}

/* ===================================
   Dimension Panels
   =================================== */
.dimension-panel {
    position: fixed;
    bottom: -600px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    background: var(--bg-white);
    padding: 28px;
    border-radius: 8px 8px 0 0;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--primary);
    border-bottom: none;
    transition: bottom 0.3s ease;
    z-index: 1000;
    display: none;
}

.dimension-panel.show {
    bottom: 0;
    display: block;
}

.dimension-panel h4 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
}

.dimension-input {
    margin-bottom: 16px;
}

.dimension-input label {
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

.dimension-input input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 15px;
    transition: all 0.2s;
    font-weight: 600;
}

.dimension-input input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.1);
}

.close-panel {
    position: absolute;
    top: 16px;
    right: 16px;
    cursor: pointer;
    font-size: 24px;
    color: var(--text-light);
    transition: all 0.2s;
    z-index: 10;
}

.close-panel:hover {
    color: var(--danger);
    transform: scale(1.1);
}

/* ===================================
   Video Element
   =================================== */
#videoElement {
    width: 100%;
    border-radius: 4px;
    border: 3px solid var(--primary);
}

/* ===================================
   Final Form
   =================================== */
#finalForm {
    display: none;
    margin-top: 32px;
    padding: 28px;
    background: var(--bg-gray-light);
    border-radius: 4px;
    border: 2px solid var(--border-color);
}

/* ===================================
   Floating Summary Button
   =================================== */
.floating-summary-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: 3px solid white;
    box-shadow: 0 4px 16px rgba(0, 51, 153, 0.4);
    cursor: pointer;
    font-size: 28px;
    transition: all 0.2s;
    z-index: 999;
    display: none;
}

.floating-summary-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 51, 153, 0.5);
}

.floating-summary-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid var(--bg-white);
}

/* ===================================
   Window Cards
   =================================== */
.window-card {
    background: var(--bg-white);
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 20px;
    border: 2px solid var(--border-color);
    transition: all 0.2s;
}

.window-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.window-card h5 {
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 700;
}

.window-card img {
    max-width: 100%;
    border-radius: 4px;
    margin-top: 12px;
    border: 2px solid var(--border-light);
}

.delete-window-btn {
    background: var(--bg-white);
    color: var(--danger);
    border: 2px solid var(--danger);
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s;
}

.delete-window-btn:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* ===================================
   Modal Styles
   =================================== */
.modal-content {
    border-radius: 4px;
    border: 2px solid var(--primary);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: var(--primary);
    border-bottom: none;
    padding: 20px 24px;
    color: white;
}

.modal-title {
    font-weight: 700;
    font-size: 20px;
    color: white;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 2px solid var(--border-light);
    background: var(--bg-gray-light);
}

/* ===================================
   Utilities
   =================================== */
.section-header h2 {
    margin-bottom: 8px;
}

.section-header p {
    margin-bottom: 0;
}

.camera-container {
    max-width: 800px;
    margin: 0 auto;
}

.alert {
    padding: 14px 18px;
    border-radius: 4px;
    border: 2px solid transparent;
    font-size: 14px;
}

.alert-info {
    background: #e7f3ff;
    border-color: #b3d9ff;
    color: #003399;
}

.d-flex { display: flex; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.align-items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.d-block { display: block; }
.border-top { border-top: 1px solid var(--border-color); }
.pt-3 { padding-top: 12px; }
.my-4 { margin-top: 16px; margin-bottom: 16px; }

.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 24px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 24px; }

.me-1 { margin-right: 4px; }
.me-2 { margin-right: 8px; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    .main-container {
        margin: 90px 16px 32px;
        padding: 24px;
    }
    
    h2 { 
        font-size: 20px; 
    }
    
    .dimension-panel {
        width: 95%;
        padding: 20px;
    }
    
    .floating-summary-btn {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .photo-zoom-wrapper {
        height: 400px;
    }
}

/* ===================================
   Print Styles
   =================================== */
@media print {
    .progress-bar-container,
    .floating-summary-btn,
    .dimension-panel,
    .zoom-controls,
    .arrow {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .main-container {
        box-shadow: none;
        border: none;
    }
}
