/* Overall Container */
#yic-image-converter-container {
    font-family: 'Poppins', sans-serif; /* A more modern, friendly font */
    max-width: 900px; /* **CHANGED: Increased max-width for wider screens** */
    margin: 40px auto;
    padding: 35px;
    border-radius: 16px; /* Even more rounded corners */
    background-color: #f7f9fd; /* A very light, calming blue-grey background */
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12); /* Deeper, softer shadow */
    overflow: hidden; /* Clear floats/margins */
    position: relative; /* For any absolute positioning of elements */
}

/* Headings */
#yic-image-converter-container h3 {
    text-align: center;
    color: #2c3e50; /* Darker, more professional blue-grey */
    margin-bottom: 30px;
    font-size: 1.8em; /* Slightly larger headings */
    font-weight: 700; /* Bolder for impact */
    letter-spacing: -0.8px;
    position: relative;
    padding-bottom: 10px;
}

#yic-image-converter-container h3::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, #6a82fb, #fc5c7d); /* Gradient underline */
    margin: 10px auto 0;
    border-radius: 2px;
}


/* Upload Area */
.yic-upload-area {
    text-align: center;
    margin-bottom: 35px;
    padding: 45px 30px; /* More padding */
    border: 3px dashed #a7bcfd; /* Vibrant blue dashed border */
    border-radius: 15px;
    background: linear-gradient(135deg, #eef5ff, #f7faff); /* Subtle gradient background */
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); /* Smooth, slightly bouncy transition */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* New: Style for drag-over effect */
.yic-upload-area.yic-drag-over {
    border-color: #4CAF50; /* A clear, inviting green */
    background-color: #e8f5e9; /* Lighter green background */
    box-shadow: 0 0 25px rgba(76, 175, 80, 0.4); /* Green shadow */
    transform: scale(1.02); /* Slightly grow to indicate readiness */
}

.yic-upload-area:hover {
    border-color: #8a9afc; /* Darker blue on hover */
    background: linear-gradient(135deg, #e0ecff, #edf4ff); /* Slightly deeper gradient on hover */
    transform: translateY(-5px); /* Lift effect */
    box-shadow: 0 10px 25px rgba(138, 154, 252, 0.3); /* Shadow that matches hover */
}

.yic-upload-area p {
    color: #6a7c8e; /* Softer text color */
    margin-top: 20px;
    font-size: 1em;
    line-height: 1.5;
}

/* File Input - Hidden */
#yic-image-upload {
    display: none;
}

/* Custom File Input Button/Label */
.yic-upload-button {
    display: inline-flex; /* Use flex for icon alignment */
    align-items: center;
    gap: 8px; /* Space between icon and text */
    background: linear-gradient(to right, #6a82fb, #fc5c7d); /* Eye-catching gradient button */
    color: white;
    padding: 15px 30px; /* Generous padding */
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.15em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(106, 130, 251, 0.4); /* Shadow matching gradient */
    margin-top: 15px;
    position: relative;
    overflow: hidden;
}

.yic-upload-button::before { /* Ripple effect */
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.yic-upload-button:hover::before {
    transform: translate(-50%, -50%) scale(15);
    opacity: 0;
}

.yic-upload-button:hover {
    transform: translateY(-3px); /* Lift on hover */
    box-shadow: 0 8px 20px rgba(106, 130, 251, 0.6); /* More pronounced shadow on hover */
    background: linear-gradient(to right, #5c74f5, #f54b6c); /* Slightly darker gradient on hover */
}

/* Preview Area */
.yic-preview-area {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px dashed #e0e0e0; /* Subtle dashed separator */
}

#yic-image-previews {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    /* **Consider increasing minmax for even larger screens if desired, e.g., minmax(180px, 1fr) or adjusting for 2 columns specifically** */
    gap: 25px; /* More space */
    margin-bottom: 35px;
}

.yic-no-images-message {
    text-align: center;
    color: #95a5a6; /* Softer grey */
    padding: 35px;
    border: 2px dashed #eceff1;
    border-radius: 10px;
    background-color: #fcfdfe;
    font-style: italic;
    font-size: 1.15em;
    grid-column: 1 / -1; /* Make message span full width in grid */
}

.yic-image-preview-item {
    border: 1px solid #eef2f6; /* Very light border */
    padding: 20px; /* More padding inside item */
    border-radius: 12px;
    text-align: center;
    background-color: #ffffff;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.06); /* Softer item shadow */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.yic-image-preview-item:hover {
    transform: translateY(-5px); /* Lift more on hover */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); /* More pronounced shadow */
}

.yic-image-preview-item img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 18px; /* More space below image */
    border-radius: 8px; /* More rounded image corners */
    max-height: 110px; /* Consistent image height */
    object-fit: contain; /* Ensure image fits without cropping */
    border: 1px solid #f5f5f5; /* Very subtle border for image itself */
}

.yic-image-preview-item p {
    font-size: 0.9em;
    word-break: break-all;
    color: #4a637d; /* Darker text for readability */
    margin: 0;
    font-weight: 500;
}

/* Conversion Options */
.yic-conversion-options {
    text-align: center;
    margin-top: 40px;
    padding: 30px;
    background-color: #e6f7ff; /* Light, inviting blue background */
    border-radius: 12px;
    border: 1px solid #cceeff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px; /* More space between elements */
    box-shadow: 0 6px 18px rgba(0, 150, 255, 0.1); /* Light shadow for the section */
}

.yic-conversion-options h3 {
    margin-bottom: 18px; /* Adjusted margin */
}

/* Select Dropdown */
#yic-conversion-format {
    padding: 14px 20px; /* Larger padding */
    border-radius: 10px; /* More rounded */
    border: 1px solid #a0d3f7; /* Softer, blue-tinted border */
    background-color: #ffffff;
    font-size: 1.1em;
    color: #34495e; /* Dark text */
    min-width: 200px; /* Wider dropdown */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23777' width='24px' height='24px'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3C/svg%3E"); /* Custom arrow */
    background-repeat: no-repeat;
    background-position: right 15px center;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); /* Subtle shadow for dropdown */
}

#yic-conversion-format:focus {
    outline: none;
    border-color: #007bff; /* Primary blue on focus */
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.3); /* Stronger focus ring */
}

/* Convert Button */
#yic-convert-button {
    background: linear-gradient(to right, #2ecc71, #27ae60); /* Fresh green gradient */
    color: white;
    padding: 16px 35px; /* Generous padding */
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2em; /* Larger text */
    font-weight: 700; /* Bolder */
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.4); /* Green shadow */
    text-transform: uppercase; /* Uppercase text */
    letter-spacing: 0.5px;
}

#yic-convert-button:hover {
    background: linear-gradient(to right, #27ae60, #229954); /* Darker green on hover */
    transform: translateY(-4px); /* Lift effect */
    box-shadow: 0 10px 25px rgba(46, 204, 113, 0.6); /* More pronounced shadow */
}

#yic-convert-button:disabled {
    background: #bdc3c7; /* Grey disabled color */
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Messages */
#yic-messages {
    margin-top: 35px;
    padding: 18px;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
    display: none; /* Hidden by default, shown by JS */
    border: 1px solid transparent; /* Base border for messages */
    animation: fadeIn 0.5s ease-out; /* Fade in animation */
}

#yic-messages.yic-message {
    display: block;
}

/* Info message style */
#yic-messages[style*="background-color: rgb(224, 242, 247)"] {
    background-color: #e3f2fd !important;
    color: #1976d2 !important; /* Blue for info */
    border-color: #90caf9 !important;
}

/* Error message style */
#yic-messages[style*="background-color: rgb(255, 204, 203)"] {
    background-color: #ffebee !important;
    color: #c62828 !important; /* Deeper red for errors */
    border-color: #ef9a9a !important;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Adjustments */
@media (max-width: 992px) { /* Adjust for common tablet/small laptop breakpoints */
    #yic-image-converter-container {
        max-width: 700px; /* Bring back slightly smaller max-width for tablets */
        padding: 30px;
    }
}

@media (max-width: 768px) { /* Standard tablet portrait */
    #yic-image-converter-container {
        max-width: 100%; /* Allow full width, with padding */
        margin-left: 15px;
        margin-right: 15px;
        padding: 25px;
    }

    #yic-image-previews {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* Allow smaller previews */
        gap: 15px;
    }

    .yic-image-preview-item img {
        max-height: 90px;
    }

    .yic-conversion-options {
        padding: 20px;
        gap: 20px;
    }
}

@media (max-width: 480px) { /* Common phone landscape/portrait */
    #yic-image-converter-container {
        padding: 20px;
        margin: 20px auto;
    }

    .yic-upload-area {
        padding: 25px 15px;
    }

    .yic-upload-button {
        font-size: 1em;
        padding: 12px 20px;
    }

    .yic-image-preview-item {
        padding: 10px;
    }

    .yic-image-preview-item img {
        max-height: 80px;
        margin-bottom: 10px;
    }

    #yic-conversion-format {
        font-size: 0.95em;
        padding: 10px 15px;
        min-width: unset; /* Allow it to shrink */
        width: 100%; /* Take full width */
    }

    #yic-convert-button {
        font-size: 1.05em;
        padding: 12px 25px;
    }
}