/* CSS Variables */
:root {
    --primary-color: #667eea;
    --primary-color-rgb: 102, 126, 234;
    --card-background: #2d3748;
    --border-color: #4a5568;
    --text-color: #ffffff;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    padding: 10px;
    color: #ffffff;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: #2d3748;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border: 1px solid #4a5568;
}

/* Header */
header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.header-logo {
    text-align: left;
}

.header-logo h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    color: #a0aec0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.admin-badge {
    color: #fc8181;
}

.btn-logout {
    background: #4a5568;
    color: #ffffff;
    border: 2px solid #718096;
    padding: 8px 15px;
    font-size: 14px;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #2d3748;
    border-color: #4a5568;
    color: #ffffff;
}

/* Navigation */
.header-nav {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #4a5568;
    color: #ffffff;
    border: 2px solid #718096;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 140px;
    justify-content: center;
}

.nav-link:hover {
    background: #2d3748;
    border-color: #4a5568;
    color: #ffffff;
    transform: translateY(-2px);
}

/* Mobile menu elements - hidden on desktop */
.mobile-user-info,
.mobile-logout {
    display: none;
}

/* Hamburger Menu */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.hamburger-menu span {
    display: block;
    height: 3px;
    width: 100%;
    background: #ffffff;
    border-radius: 3px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(135deg);
    position: relative;
    top: 6px;
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-135deg);
    position: relative;
    top: -6px;
}

/* Form Styles */
.audit-form {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #ffffff;
}

.required {
    color: #e74c3c;
}

/* Input Styles */
input[type="text"],
input[type="date"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #4a5568;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background-color: #1a202c;
    color: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background-color: #2d3748;
    color: #ffffff;
}

input::placeholder,
textarea::placeholder {
    color: #a0aec0;
}

select {
    cursor: pointer;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    justify-content: center;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #4a5568;
    color: #ffffff;
    border: 2px solid #718096;
}

.btn-secondary:hover {
    background: #2d3748;
    border-color: #4a5568;
    color: #ffffff;
}

.btn-add {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    width: 100%;
    margin-top: 10px;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-submit {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    margin-top: 20px;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Map Container */
.map-container {
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #4a5568;
}

#map {
    height: 300px;
    width: 100%;
}

/* Snagging Issue Styles */
.issue-item {
    background: #1a202c;
    border: 2px solid #4a5568;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    position: relative;
    color: #ffffff;
}

.issue-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 15px;
}

.issue-number {
    font-weight: 600;
    color: #ffffff;
    font-size: 1.1rem;
}

.remove-issue {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-issue:hover {
    background: #dc3545;
    color: white;
}

/* Image Upload Styles */
.image-upload-group {
    margin: 15px 0;
}

.image-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.image-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.image-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    border: 2px dashed #718096;
    border-radius: 8px;
    background: #2d3748;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 60px;
    color: #a0aec0;
}

.image-upload-label:hover {
    border-color: #667eea;
    background: #4a5568;
    color: #e8eaed;
}

.image-preview {
    margin-top: 10px;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Image compression progress and info */
.compression-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #2d3748;
    border: 2px dashed #4a5568;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    animation: pulse 2s infinite;
}

.compression-progress i {
    margin-right: 8px;
    color: #667eea;
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.compression-info {
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid #667eea;
    border-radius: 4px;
    text-align: center;
}

.compression-info small {
    color: #667eea;
    font-weight: 500;
    font-size: 12px;
}

.file-info {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #2d3748;
    border: 2px solid #4a5568;
    border-radius: 8px;
    color: #ffffff;
}

.file-info i {
    margin-right: 10px;
    color: #667eea;
    font-size: 18px;
}

.file-info span {
    font-size: 14px;
}

/* Status Toggle */
.status-toggle {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.status-toggle .btn {
    flex: 1;
    font-size: 14px;
    padding: 10px;
}

.status-toggle .btn.active {
    transform: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 0;
        min-height: calc(100vh - 20px);
    }
    
    /* Header mobile adjustments */
    .header-top {
        margin-bottom: 10px;
    }
    
    .header-logo h1 {
        font-size: 1.5rem;
    }
    
    .header-logo p {
        font-size: 0.8rem;
    }
    
    .header-actions {
        display: none; /* Hide on mobile, will be in hamburger menu */
    }
    
    .hamburger-menu {
        display: flex; /* Show hamburger menu on mobile */
    }
    
    .header-nav {
        display: none; /* Hidden by default on mobile */
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
        background: rgba(26, 32, 44, 0.95);
        padding: 20px;
        border-radius: 10px;
        border: 2px solid #4a5568;
    }
    
    .header-nav.active {
        display: flex; /* Show when hamburger is active */
    }
    
    .nav-link {
        width: 100%;
        min-width: auto;
        padding: 15px;
        font-size: 16px;
        border-radius: 8px;
    }
    
    /* Mobile menu user info */
    .mobile-user-info {
        display: block;
        padding: 12px 15px;
        background: #2d3748;
        border-radius: 8px;
        text-align: center;
        color: #a0aec0;
        font-size: 14px;
        margin-bottom: 10px;
        border: 1px solid #4a5568;
    }
    
    .mobile-logout {
        display: block;
        padding: 15px;
        background: #dc3545;
        color: #ffffff;
        border-radius: 8px;
        text-align: center;
        font-weight: 600;
        margin-top: 10px;
        cursor: pointer;
        transition: background 0.3s ease;
        text-decoration: none;
    }
    
    .mobile-logout:hover {
        background: #c82333;
        color: #ffffff;
    }
    
    .audit-form {
        padding: 15px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .btn-submit {
        padding: 12px;
        font-size: 16px;
    }
    
    .issue-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .status-toggle {
        flex-direction: column;
    }
    
    #map {
        height: 250px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }
    
    .container {
        border-radius: 0;
        margin: 0;
        min-height: 100vh;
    }
    
    .audit-form {
        padding: 10px;
    }
    
    input[type="text"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Loading and Success States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.success-message {
    background: #1a202c;
    color: #68d391;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #38a169;
    margin: 15px 0;
    text-align: center;
}

.error-message {
    background: #1a202c;
    color: #fc8181;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e53e3e;
    margin: 15px 0;
    text-align: center;
}


/* Signature Pad Styles */
.signature-container {
    border: 2px solid #4a5568;
    border-radius: 8px;
    background: #1a202c;
    padding: 15px;
    text-align: center;
    position: relative;
}

.signature-pad {
    border: 2px solid #718096;
    border-radius: 6px;
    background: #ffffff;
    cursor: crosshair;
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    height: 150px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.signature-pad:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.signature-pad:active {
    background-color: #f8f9fa;
}

.signature-controls {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    min-width: auto;
    border-radius: 6px;
    border: 1px solid #4a5568;
}

/* Signature Help Text */
.signature-help-text {
    display: block;
    margin-top: 10px;
    color: #a0aec0;
    font-size: 13px;
    font-style: italic;
    text-align: center;
    padding: 8px;
    background: rgba(74, 85, 104, 0.3);
    border-radius: 4px;
    border: 1px solid #4a5568;
}

.signature-help-text i {
    margin-right: 6px;
    color: #667eea;
    font-size: 14px;
}

/* Mobile signature enhancements */
@media (max-width: 768px) {
    .signature-container {
        padding: 20px 10px;
    }
    
    .signature-pad {
        height: 120px;
        border-width: 3px;
        min-height: 120px;
    }
    
    .signature-controls {
        margin-top: 20px;
        justify-content: space-around;
    }
    
    .btn-small {
        padding: 12px 20px;
        font-size: 16px;
        flex: 1;
        max-width: 150px;
    }
    
    .signature-help-text {
        font-size: 14px;
        margin-top: 12px;
    }
}

@media (max-width: 480px) {
    .signature-pad {
        height: 100px;
        min-height: 100px;
    }
    
    .signature-controls {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .btn-small {
        width: 100%;
        max-width: 200px;
        padding: 15px 20px;
        font-size: 16px;
    }
}

/* Copyright Notice */
.copyright-notice {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(45, 55, 72, 0.9);
    color: #a0aec0;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    z-index: 1000;
    border: 1px solid #4a5568;
    backdrop-filter: blur(5px);
}

.copyright-notice:hover {
    background: rgba(45, 55, 72, 0.95);
    color: #e2e8f0;
}

/* Enhanced mobile touch interactions */
@media (hover: none) and (pointer: coarse) {
    /* Mobile device styles */
    .signature-pad {
        height: 140px;
        border-width: 3px;
        border-color: #667eea;
    }
    
    .btn {
        min-height: 44px; /* iOS recommended touch target size */
        font-size: 16px;
    }
    
    .radio-group input[type="radio"] {
        width: 20px;
        height: 20px;
    }
    
    .remove-issue {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}

/* Portrait orientation adjustments */
@media screen and (orientation: portrait) and (max-width: 768px) {
    .signature-pad {
        height: 120px;
    }
    
    .signature-container {
        margin: 15px 0;
    }
}

/* Landscape orientation on mobile */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .signature-pad {
        height: 80px;
    }
    
    .signature-container {
        padding: 10px;
    }
}

/* Checklist Styles */
.checklist-section {
    background: #1a202c;
    border: 2px solid #4a5568;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.checklist-title {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.checklist-title i {
    color: #667eea;
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checklist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #2d3748;
    border-radius: 8px;
    border: 1px solid #4a5568;
}

.checklist-label {
    color: #ffffff;
    font-weight: 500;
    flex: 1;
    margin-right: 15px;
}

.radio-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #ffffff;
    font-weight: normal;
    cursor: pointer;
    white-space: nowrap;
    margin: 0;
}

.radio-group input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: #667eea;
}

.radio-group input[type="radio"]:checked {
    background: #667eea;
}

/* Mobile checklist adjustments */
@media (max-width: 768px) {
    .checklist-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .checklist-label {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .radio-group {
        align-self: stretch;
        justify-content: space-around;
        background: #1a202c;
        padding: 8px;
        border-radius: 6px;
    }
}

@media (max-width: 480px) {
    .radio-group {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .radio-group label {
        padding: 4px 0;
    }
}
