/* Photos App Styles */

/* Header */
.app-header {
    background: #1a202c;
    border: 1px solid #4a5568;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #ffffff;
}

.btn-back,
.btn-icon {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fbbf24;
    transition: all 0.2s ease;
    border-radius: 8px;
    min-width: 44px;
    min-height: 44px;
}

.btn-back:hover,
.btn-icon:hover {
    background: rgba(251, 191, 36, 0.1);
}

.btn-back:active,
.btn-icon:active {
    transform: scale(0.95);
}

/* Photos Content */
.photos-content {
    padding: 0;
    background: #1a202c;
    color: #ffffff;
}

/* Job Info Card */
.job-info-card {
    background: #2d3748;
    padding: 1rem;
    border: 1px solid #4a5568;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.job-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.job-booking-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.job-vehicle-info {
    font-size: 0.9rem;
    color: #718096;
}

.job-photos-count {
    text-align: right;
    font-size: 0.9rem;
    color: #718096;
}

.job-photos-count span {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fbbf24;
    display: block;
}

/* Camera Mode Section */
.camera-mode-section {
    padding: 1rem;
}

/* Camera Preview Container */
.camera-preview-container {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.camera-preview {
    width: 100%;
    height: auto;
    min-height: 400px;
    display: block;
    object-fit: cover;
}

/* Camera Overlay */
.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.camera-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 60%;
    max-width: 400px;
    max-height: 400px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3);
}

/* Camera Guidelines */
.camera-guidelines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.3;
}

.guideline {
    position: absolute;
    background: #2d3748;
}

.guideline-h {
    width: 100%;
    height: 1px;
    top: 50%;
    left: 0;
}

.guideline-v {
    width: 1px;
    height: 100%;
    top: 0;
    left: 50%;
}

/* Camera Status */
.camera-status {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    backdrop-filter: blur(4px);
    z-index: 10;
    pointer-events: none;
}

.camera-status-ready {
    background: rgba(251, 191, 36, 0.9);
}

.camera-status-active {
    background: rgba(25, 135, 84, 0.9);
    animation: statusPulse 1.5s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Camera Controls Overlay */
.camera-controls-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 10;
}

.btn-camera-control {
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.btn-camera-control:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

.btn-camera-control:active {
    transform: scale(0.95);
}

/* Capture Controls */
.capture-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.capture-controls .btn {
    width: 100%;
    max-width: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 54px;
}

/* Capture Button */
.capture-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 0;
}

.btn-capture {
    width: 80px;
    height: 80px;
    background: #2d3748;
    border: 4px solid #fbbf24;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.btn-capture:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(251, 191, 36, 0.4);
}

.btn-capture:active {
    transform: scale(0.95);
}

.capture-inner {
    width: 64px;
    height: 64px;
    background: #fbbf24;
    border-radius: 50%;
    transition: all 0.2s;
}

.btn-capture:active .capture-inner {
    background: #0b5ed7;
    width: 56px;
    height: 56px;
}

/* Photo Description Section */
.photo-description-section {
    background: #2d3748;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.photo-description-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #a0aec0;
}

.photo-description-section textarea {
    width: 100%;
    border: 2px solid #4a5568;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 1rem;
    transition: border-color 0.2s;
    resize: none;
}

.photo-description-section textarea:focus {
    border-color: #fbbf24;
    box-shadow: 0 0 0 0.25rem rgba(251, 191, 36, 0.15);
    outline: none;
}

/* Preview Mode Section */
.preview-mode-section {
    padding: 1rem;
}

.preview-container {
    background: #2d3748;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.photo-preview {
    width: 100%;
    height: auto;
    display: block;
}

/* Preview Actions */
.preview-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: #1a202c;
    border: 1px solid #4a5568;
    color: #ffffff;
}

.preview-actions .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 54px;
}

/* Photo Gallery Section */
.photo-gallery-section {
    background: #2d3748;
    margin: 1rem;
    margin-top: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    overflow: hidden;
}

.photo-gallery-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border: 1px solid #4a5568;
    background: #1a202c;
    color: #ffffff;
}

.photo-gallery-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

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

.photo-grid .text-muted {
    grid-column: 1 / -1;
    padding: 2rem;
}

/* Photo Card */
.photo-card {
    background: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.photo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.photo-card-image {
    width: 100%;
    padding-top: 75%; /* 4:3 aspect ratio */
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    position: relative;
}

.photo-card-info {
    padding: 0.75rem;
}

.photo-status {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.photo-status-uploaded {
    background: #d1e7dd;
    color: #0f5132;
}

.photo-status-pending {
    background: #fff3cd;
    color: #664d03;
}

.photo-description {
    font-size: 0.875rem;
    color: #a0aec0;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-date {
    font-size: 0.75rem;
    color: #718096;
}

/* Photo Lightbox */
.photo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(4px);
}

.lightbox-header {
    padding: 1rem;
    display: flex;
    justify-content: flex-end;
}

.btn-lightbox-close {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.lightbox-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow: auto;
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.lightbox-info {
    margin-top: 1.5rem;
    text-align: center;
    color: white;
    max-width: 600px;
}

.lightbox-description {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.lightbox-date {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.lightbox-actions {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    justify-content: center;
}

.lightbox-actions .btn {
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
}

/* Touch Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 48px;
    }
    
    .form-control {
        min-height: 48px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn-camera-control {
        width: 54px;
        height: 54px;
    }
    
    .btn-capture {
        width: 90px;
        height: 90px;
    }
}

/* Tablet Landscape */
@media (min-width: 768px) and (orientation: landscape) {
    .camera-mode-section {
        padding: 1.5rem;
    }
    
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* Desktop/Large Screens */
@media (min-width: 992px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-text {
    color: white;
    margin-top: 1rem;
    font-size: 1rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.photo-card {
    animation: slideUp 0.3s ease-out;
}

.photo-lightbox {
    animation: fadeIn 0.2s ease-out;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #ffffff;
        color: #374151;
    }

    .photos-content {
        background: #0f172a;
    }

    .job-info-card,
    .photo-gallery-section {
        background: #2d2d2d;
        color: #374151;
    }

    .photo-gallery-section .section-header,
    .preview-actions {
        background: #1a1a1a;
        color: #374151;
        border-color: #a0aec0;
    }

    .job-booking-number,
    .photo-count {
        color: #374151 !important;
    }

    .text-muted {
        color: #adb5bd !important;
    }

    .photo-card {
        background: #2d2d2d;
        border-color: #a0aec0;
    }

    .photo-card:hover {
        background: #1a1a1a;
    }
}
