/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

/* Header */
.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    font-size: 0.9rem;
}

/* Card */
.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 1.2rem;
}

/* Action bar */
.action-bar {
    margin-bottom: 30px;
}

/* Error message */
.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid #fcc;
}

/* Footer */
.footer {
    text-align: center;
    color: white;
    margin-top: 20px;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Gallery */
.gallery {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state p {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* Date sections */
.date-section {
    margin-bottom: 40px;
}

.date-section:last-child {
    margin-bottom: 0;
}

.date-header {
    font-size: 1.3rem;
    color: #667eea;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

/* Photo grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.photo-card {
    background: #f5f5f5;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    cursor: pointer;
}

.photo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

.photo-info {
    padding: 10px;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    padding: 20px;
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

/* Capture page */
.capture-area {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.camera-view {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 20px;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

.camera-view video,
.camera-view img {
    width: 100%;
    height: auto;
    display: block;
}

.capture-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#retakeButtons {
    display: flex;
    gap: 15px;
}

#retakeButtons button {
    flex: 1;
}

.upload-status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.upload-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.upload-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Hamburger menu */
.hamburger-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    transition: transform 0.3s;
}

.hamburger-btn:hover {
    transform: scale(1.1);
}

.hamburger-menu {
    position: absolute;
    top: 100px;
    right: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
    min-width: 150px;
    padding: 10px;
}

.hamburger-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hamburger-menu .btn {
    width: 100%;
}

/* Mobile optimizations */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 20px;
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .photo-card img {
        height: 120px;
    }

    .header-actions {
        flex-direction: row;
        gap: 10px;
    }

    .hamburger-menu {
        right: 10px;
        top: 90px;
    }
}

/* Landscape mode for camera */
@media (orientation: landscape) {
    .camera-view {
        max-width: 80vh;
    }
}
