/* GPS Camera App - Stylesheet */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container - Mobile-first */
.container {
    max-width: 100%;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 15px;
}

/* Desktop styles */
@media (min-width: 768px) {
    body {
        padding: 20px;
    }
    
    .container {
        max-width: 600px;
        padding: 25px;
    }
}

/* Header */
header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

header h1 {
    font-size: 1.75rem;
    color: #667eea;
    margin-bottom: 8px;
    font-weight: 700;
}

.subtitle {
    color: #666;
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    header {
        margin-bottom: 25px;
        padding-bottom: 20px;
    }
    
    header h1 {
        font-size: 2rem;
        margin-bottom: 10px;
    }
    
    .subtitle {
        font-size: 1rem;
    }
}

/* Status area */
.status-area {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .status-area {
        padding: 15px;
        margin-bottom: 20px;
        font-size: 0.95rem;
    }
}

.status-info {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #90caf9;
}

.status-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #81c784;
}

.status-error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
}

/* Controls section */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    align-items: stretch;
}

/* Buttons - Mobile-first */
.btn {
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 52px; /* Extra touch-friendly for mobile */
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    -webkit-tap-highlight-color: transparent;
}

@media (min-width: 768px) {
    .controls-section {
        gap: 15px;
        margin-bottom: 25px;
        align-items: center;
    }
    
    .btn {
        padding: 14px 28px;
        font-size: 1rem;
        min-height: 48px;
        width: auto;
        min-width: 180px;
    }
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

/* Location info - Mobile-first */
.location-info {
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 10px;
    width: 100%;
    text-align: left;
    border: 1px solid #e0e0e0;
}

.location-info .info-row {
    margin: 10px 0;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.location-info .info-row:first-child {
    margin-top: 0;
}

.location-info .info-row:last-child {
    margin-bottom: 0;
}

.location-info strong {
    color: #667eea;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.location-info span {
    color: #333;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 0.9rem;
    word-break: break-word;
    line-height: 1.4;
}

/* Address span specific styling */
#address {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.85rem;
    color: #2c3e50;
    font-weight: 500;
}

@media (min-width: 768px) {
    .location-info {
        padding: 15px;
        max-width: 550px;
        margin: 0 auto;
    }
    
    .location-info .info-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        margin: 8px 0;
        font-size: 0.95rem;
    }
    
    .location-info strong {
        min-width: 100px;
        font-size: 0.9rem;
    }
    
    .location-info span {
        font-size: 0.95rem;
        text-align: right;
    }
    
    #address {
        text-align: left;
        font-size: 0.9rem;
    }
}

/* Camera section */
.camera-section {
    margin-bottom: 15px;
}

.camera-section h2 {
    font-size: 1.2rem;
    color: #667eea;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 700;
}

.camera-container {
    position: relative;
    width: 100%;
    margin: 0 auto 15px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    background: #000;
    aspect-ratio: 4 / 3;
}

@media (min-width: 768px) {
    .camera-section {
        margin-bottom: 20px;
    }
    
    .camera-section h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .camera-container {
        max-width: 600px;
        margin-bottom: 20px;
    }
}

#videoElement,
#previewCanvas {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.hidden {
    display: none !important;
}

/* Camera controls */
.camera-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

@media (min-width: 768px) {
    .camera-controls {
        flex-direction: row;
        justify-content: center;
        gap: 15px;
    }
    
    .camera-controls .btn {
        width: auto;
        min-width: 180px;
    }
}

/* Additional mobile optimizations */
@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    
    .container {
        padding: 12px;
        border-radius: 10px;
    }
    
    header {
        margin-bottom: 15px;
        padding-bottom: 12px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .status-area {
        padding: 10px;
        font-size: 0.8rem;
    }
    
    .location-info {
        padding: 10px;
    }
    
    .location-info .info-row {
        margin: 8px 0;
        font-size: 0.8rem;
    }
    
    .location-info strong {
        font-size: 0.75rem;
    }
    
    .location-info span {
        font-size: 0.85rem;
    }
}

/* Accessibility improvements */
.btn:focus,
#videoElement:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .container {
        box-shadow: none;
    }
    
    .btn,
    .camera-section {
        display: none;
    }
}

