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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: linear-gradient(135deg, #f5f7fa 0%, #e3f2fd 50%, #e8f5e9 100%);
    min-height: 100vh;
    background-attachment: fixed;
}

/* Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px 100px 16px;
}

/* Header with Integrated Tabs */
.header {
    background: linear-gradient(135deg, #4FC3F7, #81C784);
    color: white;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 900px;
    margin: 0 auto;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    padding: 20px 16px 16px 16px;
}

.header-logo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-text {
    text-align: left;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 4px;
    font-weight: 600;
}

.header p {
    font-size: 14px;
    margin: 0;
    opacity: 0.95;
}

/* Header Tabs - Hidden on Mobile */
.header-tabs {
    display: none;
}

@media (min-width: 769px) {
    .header-tabs {
        display: flex;
        justify-content: center;
        gap: 0;
        padding: 0 16px;
        margin-top: 16px;
    }

    .header-tab {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 12px 32px 14px 32px;
        text-decoration: none;
        font-size: 15px;
        font-weight: 500;
        color: rgba(255, 255, 255, 0.8);
        background: transparent;
        border: none;
        border-bottom: 3px solid transparent;
        transition: all 0.3s ease;
        position: relative;
    }

    .header-tab:hover {
        background: rgba(255, 255, 255, 0.15);
        color: white;
    }

    .header-tab.active {
        background: rgba(255, 255, 255, 0.25);
        color: white;
        border-bottom: 3px solid white;
        font-weight: 600;
    }

    .header-tab .tab-icon {
        font-size: 18px;
    }
}

/* Offline Indicator */
.offline-indicator {
    background: #FF9800;
    color: white;
    padding: 12px 16px;
    text-align: center;
    font-weight: 500;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.offline-indicator.show {
    transform: translateY(0);
}

/* Form Sections */
.form-section {
    background: linear-gradient(135deg, rgba(248, 249, 251, 1) 0%, rgba(243, 245, 248, 1) 100%);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(20px);
    position: relative;
}

.form-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #2c3e50;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Photo Section */
.photo-container {
    text-align: center;
}

.photo-capture {
    padding: 30px 20px;
    border: 2.5px dashed rgba(79, 195, 247, 0.5);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(238, 242, 246, 1) 0%, rgba(233, 238, 243, 1) 100%);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.photo-capture:hover {
    border-color: #4FC3F7;
    background: linear-gradient(135deg, rgba(224, 240, 255, 1) 0%, rgba(220, 235, 250, 1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 195, 247, 0.25);
}

.camera-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.7;
    background: linear-gradient(135deg, #4FC3F7, #81C784);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: transform 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.photo-capture:hover .camera-icon {
    transform: scale(1.1);
}

.photo-count {
    margin-left: 8px;
    font-size: 14px;
    opacity: 0.8;
}

/* Photo Preview Grid */
.photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    padding: 12px;
    margin-bottom: 20px;
    background: rgba(238, 242, 246, 0.5);
    border-radius: 12px;
}

.photo-thumbnail {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-thumbnail:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.photo-thumbnail img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.photo-thumbnail .remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(244, 67, 54, 0.95);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.4);
}

.photo-thumbnail .remove-btn:hover {
    background: rgba(211, 47, 47, 1);
    transform: scale(1.1);
}

.photo-thumbnail .photo-number {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(79, 195, 247, 0.95);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Old single photo preview (keep for backward compatibility) */
.photo-preview {
    position: relative;
}

.photo-preview img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    margin-bottom: 16px;
}

/* Location Section */
.location-container {
    text-align: center;
}

.location-display {
    margin-top: 16px;
    padding: 16px;
    background: #E8F5E8;
    border-radius: 8px;
    text-align: left;
}

.location-display p {
    margin-bottom: 8px;
    font-size: 14px;
}

.location-address {
    color: #666;
    font-style: italic;
}

.manual-location {
    margin-top: 16px;
    text-align: left;
}

/* Input Groups */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 14px;
    border: 1.5px solid #d1d9e2;
    border-radius: 10px;
    font-size: 16px;
    background: #f6f8fa;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #4FC3F7;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.char-counter {
    display: block;
    text-align: right;
    margin-top: 4px;
    color: #666;
    font-size: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
    min-width: 48px;
    touch-action: manipulation;
}

.btn-primary {
    background: linear-gradient(135deg, #4FC3F7, #81C784);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #42A5F5, #66BB6A);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover:not(:disabled) {
    background: #eeeeee;
    border-color: #bbb;
}

.btn-large {
    width: 100%;
    padding: 16px 24px;
    font-size: 18px;
    font-weight: 600;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Consent Section */
.consent-container {
    background: linear-gradient(135deg, #FFF8F0 0%, #FFF3E0 100%);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #FF9800;
    box-shadow: 0 1px 4px rgba(251, 146, 60, 0.1);
}

.consent-checkbox-wrapper {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    line-height: 1.5;
}

.consent-checkbox {
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    flex-shrink: 0;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    cursor: pointer;
    -webkit-appearance: checkbox !important;
    appearance: checkbox !important;
    accent-color: #4FC3F7;
}

/* Force checkbox to be visible in Chrome */
input[type="checkbox"].consent-checkbox {
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    appearance: checkbox !important;
    transform: scale(1.2);
    vertical-align: middle;
}

/* Webkit specific fixes for Chrome/Safari */
@supports (-webkit-appearance: none) {
    .consent-checkbox {
        -webkit-appearance: checkbox !important;
    }
}

.consent-label {
    font-size: 14px;
    color: #555;
    display: inline-block !important;
    visibility: visible !important;
    user-select: none;
    cursor: pointer;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 32px 24px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    transform: scale(0.9);
    animation: modalIn 0.2s ease forwards;
}

@keyframes modalIn {
    to {
        transform: scale(1);
    }
}

.success-icon,
.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.modal-content h2 {
    margin-bottom: 16px;
    color: #333;
}

.modal-content p {
    margin-bottom: 16px;
    color: #666;
    line-height: 1.5;
}

.modal-content .btn {
    margin: 8px;
}

/* Help Text */
.help-text {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 8px;
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    padding: 16px;
    margin-top: 24px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.footer p {
    margin: 4px 0;
    font-size: 12px;
    color: #666;
}

.footer a {
    color: #4FC3F7;
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        padding: 0 12px 80px 12px;
    }
    
    .form-section {
        padding: 20px 16px;
    }
    
    .header {
        padding: 20px 12px;
    }
    
    .btn {
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .btn-large {
        padding: 18px 20px;
        font-size: 16px;
    }
}

/* Removed dark mode for cleaner, consistent light theme */

/* High contrast mode */
@media (prefers-contrast: high) {
    .btn-primary {
        background: #0066CC;
    }
    
    .form-section {
        border: 2px solid #333;
    }
    
    .input-group input,
    .input-group select,
    .input-group textarea {
        border: 2px solid #333;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #4FC3F7;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .footer,
    .btn,
    .camera-icon {
        display: none;
    }
    
    .form-section {
        box-shadow: none;
        border: 1px solid #000;
        margin-bottom: 20px;
        break-inside: avoid;
    }
}