/* ===================================
   Image Upload Styles
   =================================== */

.image-upload-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.image-upload-container input[type="url"] {
    flex: 1;
}

.image-preview {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin-top: 12px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px;
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

.btn-remove-image {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-remove-image:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

.form-hint {
    display: block;
    color: var(--color-gray);
    font-size: 13px;
    margin-top: 6px;
}

/* Comment Image Upload */
.comment-image-upload {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.comment-image-preview {
    position: relative;
    max-width: 200px;
    margin-top: 12px;
}

.comment-image-preview img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 2px solid var(--border-color);
}

.comment-image-preview .btn-remove-image {
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
}

/* Loading State */
.image-uploading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.image-uploading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 215, 0, 0.3);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* URL Input Wrapper */
.url-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: var(--color-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.url-input-wrapper:focus-within {
    border-color: var(--color-primary);
    background: rgba(255, 215, 0, 0.05);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.url-input-wrapper > i {
    color: var(--color-gray);
    font-size: 16px;
    transition: color 0.3s ease;
}

.url-input-wrapper:focus-within > i {
    color: var(--color-primary);
}

.url-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--color-dark);
    font-size: 14px;
    padding: 0;
}

.url-input::placeholder {
    color: var(--color-gray);
}

.btn-load-url {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    color: var(--color-dark);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-load-url:hover {
    background: var(--color-secondary);
    transform: scale(1.1);
}

.btn-load-url i {
    font-size: 14px;
}
