/* CMS Image Upload Component Styles */

/* ==========================================
   Color Variables (EAA Brand)
   ========================================== */
:root {
    --eaa-green: #0d5d2c;
    --eaa-gold: #f0b323;
    --upload-border: #ccc;
    --upload-hover: #0d5d2c;
    --upload-bg-hover: rgba(13, 93, 44, 0.05);
}

/* ==========================================
   Base Upload Container
   ========================================== */
.cms-image-upload {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cms-image-upload:hover {
    border-color: var(--eaa-green) !important;
    background-color: var(--upload-bg-hover);
}

/* ==========================================
   Drag Hover State
   ========================================== */
.cms-image-upload.drag-hover {
    border-color: var(--eaa-gold) !important;
    border-style: solid !important;
    background-color: rgba(240, 179, 35, 0.1);
    box-shadow: 0 4px 12px rgba(240, 179, 35, 0.3);
}

.cms-image-upload.drag-hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(13, 93, 44, 0.05) 0%, rgba(240, 179, 35, 0.05) 100%);
    pointer-events: none;
}

/* ==========================================
   Uploading State
   ========================================== */
.cms-image-upload.uploading {
    border-color: var(--eaa-green) !important;
    background-color: rgba(13, 93, 44, 0.05);
    cursor: wait;
}

.cms-image-upload.uploading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(13, 93, 44, 0.1) 50%,
        transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* ==========================================
   Image Preview
   ========================================== */
.cms-image-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.cms-image-preview img {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.cms-image-preview img:hover {
    transform: scale(1.05);
}

/* ==========================================
   Upload Icon Animation
   ========================================== */
.cms-image-upload:not(.uploading):not(.drag-hover) .mud-icon-root {
    transition: transform 0.3s ease;
}

.cms-image-upload:not(.uploading):not(.drag-hover):hover .mud-icon-root {
    transform: translateY(-4px);
}

/* ==========================================
   File Upload Button Focus States
   ========================================== */
.cms-image-upload .mud-button-root:focus-visible {
    outline: 2px solid var(--eaa-gold);
    outline-offset: 2px;
}

/* ==========================================
   Responsive Adjustments
   ========================================== */
@media (max-width: 599px) {
    .cms-image-upload {
        min-height: 150px !important;
    }

    .cms-image-preview img {
        max-height: 100px !important;
    }
}

/* ==========================================
   Dark Mode Support (Optional)
   ========================================== */
@media (prefers-color-scheme: dark) {
    .cms-image-upload {
        border-color: #555 !important;
    }

    .cms-image-upload:hover {
        background-color: rgba(13, 93, 44, 0.15);
    }
}

/* ==========================================
   Accessibility
   ========================================== */
.cms-image-upload:focus-within {
    outline: 2px solid var(--eaa-gold);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cms-image-upload {
        border-width: 3px !important;
    }

    .cms-image-upload.drag-hover {
        border-width: 4px !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .cms-image-upload,
    .cms-image-upload .mud-icon-root,
    .cms-image-preview img {
        transition: none;
    }

    .cms-image-upload.uploading::before {
        animation: none;
    }
}
