/**
 * OMR Photo Upload Component Styles
 * Bootstrap 3.3.7 + Metronic 4 Theme Compatible
 * Lightbox2 Compatible - Edit Icon Design
 * Full-Size Image Support (Thumbnail Display + Full-Size Lightbox)
 * 
 * @author selcukmart <admin@hostingdevi.com>
 * @created 2025-12-20
 * @version 1.3
 */

/* ============================================
   Photo Upload Container
   ============================================ */
.omr-photo-upload-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    height: 100%;
}

/* Hidden File Input */
.omr-photo-upload-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

/* ============================================
   Clickable Photo Container
   ============================================ */
.omr-photo-clickable {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.omr-photo-clickable:hover .omr-photo-img {
    opacity: 0.8;
}

/* ============================================
   Edit Icon for Existing Photos
   ============================================ */
.omr-photo-edit-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background-color: rgba(53, 152, 220, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.omr-photo-edit-icon:hover {
    background-color: rgba(53, 152, 220, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.omr-photo-edit-icon:active {
    transform: scale(0.95);
}

.omr-photo-edit-icon i {
    color: #ffffff;
    font-size: 14px;
}

/* Focus state for accessibility */
.omr-photo-edit-icon:focus {
    outline: 2px solid #3598dc;
    outline-offset: 2px;
}

/* Hover effect on photo link to show edit icon more clearly */
.omr-photo-link:hover .omr-photo-edit-icon {
    background-color: rgba(53, 152, 220, 1);
}

/* ============================================
   Upload Icon Overlay (for existing photos)
   REMOVED - Now using edit icon instead
   ============================================ */

/* ============================================
   Placeholder for No Photo
   ============================================ */
.omr-photo-placeholder {
    cursor: pointer;
    transition: all 0.3s ease;
}

.omr-photo-placeholder:hover {
    background-color: #f0f0f0;
    border-color: #3598dc;
}

.omr-photo-placeholder:hover i {
    color: #3598dc;
}

/* ============================================
   Upload Progress Bar
   ============================================ */
.omr-upload-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-top: 1px solid #ddd;
    display: none;
    z-index: 3;
}

.omr-upload-progress-container.active {
    display: block;
}

.omr-upload-progress-bar {
    height: 20px;
    background-color: #e7ecf1;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.omr-upload-progress-fill {
    height: 100%;
    background-color: #32c5d2;
    transition: width 0.3s ease;
    position: relative;
}

/* Animated stripes for progress bar */
.omr-upload-progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 40px 40px;
    animation: omr-progress-stripes 1s linear infinite;
}

@keyframes omr-progress-stripes {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 40px 0;
    }
}

.omr-upload-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* ============================================
   Loading Spinner Overlay
   ============================================ */
.omr-photo-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.omr-photo-loading-overlay.active {
    display: flex;
}

.omr-photo-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e7ecf1;
    border-top-color: #3598dc;
    border-radius: 50%;
    animation: omr-spin 0.8s linear infinite;
}

@keyframes omr-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Drag & Drop States
   ============================================ */
.omr-photo-drag-over {
    background-color: #e8f5f9;
    border-color: #3598dc;
}

.omr-photo-drag-over::after {
    content: 'Dosyayı buraya bırakın';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 600;
    color: #3598dc;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 5;
}

/* ============================================
   Error State
   ============================================ */
.omr-photo-upload-error {
    border: 2px solid #e7505a !important;
    background-color: #fef5f5;
}

.omr-upload-error-message {
    position: absolute;
    bottom: -30px;
    left: 0;
    right: 0;
    color: #e7505a;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    padding: 5px;
}

/* ============================================
   Success State
   ============================================ */
.omr-photo-upload-success {
    animation: omr-success-pulse 0.6s ease;
}

@keyframes omr-success-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .omr-photo-edit-icon {
        width: 36px;
        height: 36px;
        top: 6px;
        right: 6px;
    }
    
    .omr-photo-edit-icon i {
        font-size: 16px;
    }
    
    .omr-upload-progress-text {
        font-size: 10px;
    }
}

/* ============================================
   Accessibility
   ============================================ */
.omr-photo-upload-input:focus + .omr-photo-clickable {
    outline: 2px solid #3598dc;
    outline-offset: 2px;
}

/* For screen readers */
.omr-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
