/* ✅ Modern Image Converter Container */
.ico-container {
    max-width: 800px;
    margin: 40px auto;
    background: #ffffff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    text-align: center;
}

/* ✅ Upload Box */
.ico-upload-box {
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    padding: 50px 20px;
    background: #f9fbfd;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    position: relative;
}

.ico-upload-box:hover, .ico-upload-box.ico-drag-over {
    border-color: #0073aa;
    background: #f0f7ff;
    transform: translateY(-2px);
}

.ico-upload-box p {
    font-size: 18px;
    color: #555;
    margin: 0;
    font-weight: 600;
}

.ico-upload-box p::before {
    content: '☁️'; /* Simple icon */
    display: block;
    font-size: 40px;
    margin-bottom: 15px;
}

/* ✅ Format Selection Grid */
.ico-format-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 25px 0;
}

.ico-format-opt {
    padding: 10px 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.ico-format-opt:hover {
    border-color: #0073aa;
    color: #0073aa;
}

.ico-format-opt.selected {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    box-shadow: 0 4px 10px rgba(0, 115, 170, 0.3);
    transform: scale(1.05);
}

/* ✅ Buttons */
.ico-btn {
    display: inline-block;
    width: 100%;
    max-width: 300px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #0073aa 0%, #00a0d2 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.3);
    margin-top: 10px;
}

.ico-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.4);
    opacity: 0.95;
}

.ico-reset-btn {
    background: transparent;
    color: #888;
    box-shadow: none;
    margin-top: 15px;
    font-size: 14px;
    text-decoration: underline;
}

.ico-reset-btn:hover {
    color: #d63638;
    background: transparent;
    transform: none;
    box-shadow: none;
}

/* ✅ Results Area */
.ico-results-grid {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ico-result-item {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.ico-thumb img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
}

.ico-info {
    flex-grow: 1;
    text-align: left;
    padding-left: 15px;
}

.ico-name {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.ico-meta {
    font-size: 12px;
    color: #888;
}

.ico-dl-btn {
    padding: 8px 16px;
    background: #28a745;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: 0.2s;
}

.ico-dl-btn:hover {
    background: #218838;
}

.ico-action-bar {
    margin-top: 25px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.zip-btn { background: #2271b1; }
.delete-btn { background: #d63638; box-shadow: 0 4px 15px rgba(214, 54, 56, 0.3); }

/* ✅ Main Container */
.ico-container {
    max-width: 800px;
    margin: 40px auto;
    background: #ffffff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    text-align: center;
}

/* ✅ Upload Box */
.ico-upload-box {
    border: 2px dashed #d1d9e6;
    border-radius: 12px;
    padding: 40px 20px;
    background: #f8fbff;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    position: relative;
}

.ico-upload-box:hover, .ico-upload-box.ico-drag-over {
    border-color: #0073aa;
    background: #eef6fc;
    transform: translateY(-2px);
}

.ico-upload-box p {
    font-size: 18px;
    color: #444;
    font-weight: 600;
    margin: 0;
}

.ico-upload-box p::before {
    content: '📂';
    display: block;
    font-size: 32px;
    margin-bottom: 10px;
}

/* ✅ Format Selection */
.ico-format-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 25px;
}

.ico-format-opt {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    transition: 0.2s;
}

.ico-format-opt:hover {
    border-color: #0073aa;
    color: #0073aa;
}

.ico-format-opt.selected {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    box-shadow: 0 4px 10px rgba(0, 115, 170, 0.2);
}

/* ✅ Main Button */
.ico-btn {
    display: block;
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    /* Background color is set dynamically via PHP/Settings, but fallback is blue */
    background-color: #0073aa; 
}

.ico-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.ico-reset-btn {
    background: none;
    border: none;
    color: #888;
    text-decoration: underline;
    cursor: pointer;
    margin-top: 15px;
    font-size: 14px;
}

/* ✅ Results Grid */
.ico-results-grid {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ✅ Result Item (Fixes the Huge Image Issue) */
.ico-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #eee;
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    text-align: left;
}

/* Thumbnail Container */
.ico-thumb {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    margin-right: 15px;
}

/* Force Image Constraint */
.ico-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image fills box without stretching */
    display: block;
}

.ico-info {
    flex-grow: 1;
    overflow: hidden;
}

.ico-name {
    display: block;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.ico-meta {
    font-size: 12px;
    color: #888;
}

/* Download Button */
.ico-dl-btn {
    padding: 8px 14px;
    background: #28a745;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: 0.2s;
}

.ico-dl-btn:hover {
    background: #218838;
}

/* ✅ Action Bar (Bottom Buttons) */
.ico-action-bar {
    margin-top: 25px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.zip-btn { 
    background: #2271b1 !important; 
    width: auto !important;
    display: inline-block;
    text-decoration: none;
    border-radius: 50px;
}

.delete-btn { 
    background: #d63638 !important; 
    width: auto !important;
    border-radius: 50px;
}

.ico-delete-form {
    display: inline-block;
}

/* Error State */
.ico-result-item.error {
    background: #fff5f5;
    border-color: #fed7d7;
}
.ico-thumb.error {
    background: #fed7d7;
    color: #c53030;
    font-size: 20px;
}

/* Mobile */
@media (max-width: 600px) {
    .ico-container { padding: 20px; }
    .ico-format-opt { width: 100%; }
}