:root {
    --primary-color: #4361ee; 
    --primary-color-dark: #3a56d4;
    --secondary-color: #f72585; 
    --secondary-color-light: #ffb3d7;
    --accent-color: #4cc9f0; 
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-color: #212529;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --border-radius: 12px;
    --box-shadow: 0 6px 25px rgba(0, 0, 0, 0.07);
    --transition: all 0.3s ease;
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --success-color: #28a745;
    --success-bg: #d4edda;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 16px;
    background-image: linear-gradient(120deg, #fdfbfb 0%, #ebedee 100%);
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 30px auto;
    background-color: var(--card-background);
    padding: 35px 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(0,0,0,0.03);
}

h1 {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 2.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.description {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 40px;
    font-size: 1.1rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.form-section {
    margin-bottom: 40px;
    background-color: #fafafa;
    padding: 25px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.form-section:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-color: var(--accent-color);
}

label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 1.05rem;
}

input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    box-sizing: border-box;
    font-size: 1rem;
    transition: var(--transition);
    background-color: white;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.25);
}

.workflow-container {
    margin-bottom: 40px;
}

.workflow-step {
    margin-bottom: 30px;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.step-header {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.step-number {
    width: 32px;
    height: 32px;
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.1rem;
    box-shadow: 0 2px 6px rgba(67, 97, 238, 0.3);
}

.step-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--text-color);
    font-weight: 600;
}

.input-options {
    padding: 25px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

@media (min-width: 768px) {
    .input-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

.input-option {
    display: flex;
    flex-direction: column;
}

.option-label {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 1.05rem;
}

.option-label .icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

.url-input-wrapper {
    border: 3px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    background-color: #f8f9fa;
    transition: var(--transition);
    height: 100%;
    display: flex;
    align-items: center;
    min-height: 120px;
}

.url-input-wrapper:focus-within {
    border-color: var(--primary-color);
    background-color: #f0f5ff;
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.15);
}

.url-input-wrapper input[type="text"] {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: white;
}

.upload-window {
    background-color: #ffffff;
    border: 3px dashed var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: none;
    padding: 0;
    position: relative;
    height: 100%;
}

.upload-window:hover {
    transform: none;
    border-color: var(--primary-color);
    background-color: #fafafa;
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.15);
}

.upload-window.drag-over {
    background-color: #f0f7ff;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(76, 201, 240, 0.3);
}

.upload-window.has-image {
    border-color: var(--success-color);
    background-color: #f9fffd;
}

.upload-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

@media (min-width: 576px) and (max-width: 767px) {
    .upload-content {
        flex-direction: row;
    }
}

.upload-preview {
    flex: 1;
    height: 200px;
    border: none;
    border-radius: 0;
    margin-top: 0;
    box-shadow: none;
    background-color: rgba(255, 255, 255, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .upload-preview {
        height: auto;
        min-height: 200px;
    }
}

.upload-controls {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(67, 97, 238, 0.03);
    border-top: 1px dashed #d0d7de;
    position: relative;
    z-index: 1;
}

@media (min-width: 576px) and (max-width: 767px) {
    .upload-controls {
        width: 180px;
        padding: 20px 15px;
        border-top: none;
        border-left: 1px dashed #d0d7de;
    }
}

.action-area {
    padding: 25px;
    text-align: center;
    background-color: #f8f9fa;
    border-top: 1px solid var(--border-color);
}

.action-area button {
    margin: 0 auto;
    display: block;
    min-width: 250px;
}

.hint {
    margin: 15px 0 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn, button#submit-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 16px 28px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    display: inline-block;
    text-align: center;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
    position: relative;
    overflow: hidden;
}

.btn::after, button#submit-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn:hover::after, button#submit-btn:hover::after {
    left: 100%;
}

.btn:hover, button#submit-btn:hover {
    background-color: var(--primary-color-dark);
    box-shadow: 0 6px 15px rgba(67, 97, 238, 0.4);
    transform: translateY(-3px);
}

.btn:active, button#submit-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(67, 97, 238, 0.3);
}

button#submit-btn {
    margin: 0 auto;
}

.separator {
    text-align: center;
    font-weight: 600;
    margin: 30px 0;
    color: var(--text-muted);
    position: relative;
}

.separator::before,
.separator::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color));
}

.separator::after {
    right: 0;
    background: linear-gradient(90deg, var(--border-color), transparent);
}

.separator::before {
    left: 0;
}

.loading {
    text-align: center;
    display: none;
    margin: 40px 0;
}

.loading p {
    color: var(--text-muted);
    margin-bottom: 15px;
    font-weight: 500;
}

.spinner {
    border: 4px solid rgba(67, 97, 238, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    color: var(--error-text);
    text-align: center;
    margin: 25px auto;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    background-color: var(--error-bg);
    border: 1px solid var(--error-text);
    display: none;
    max-width: 600px;
    font-weight: 500;
}

.result-container {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    display: none;
}

h2 {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 35px;
    font-size: 1.8rem;
    font-weight: 700;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 3px;
}

.image-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-bottom: 40px;
}

.image-card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 22px;
    text-align: center;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.image-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    opacity: 0;
    transition: var(--transition);
}

.image-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.image-card:hover::before {
    opacity: 1;
}

.image-card h3 {
    margin: 0 0 18px 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-color);
}

.image-card img {
    max-width: 100%;
    height: 220px;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 15px;
    background-color: #f8f9fa;
    transition: var(--transition);
    border: 1px solid #f0f0f0;
}

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

.download-section {
    text-align: center;
    margin-top: 40px;
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.download-section h3 {
    margin-bottom: 25px;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
    position: relative;
    display: inline-block;
}

.download-section h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    opacity: 0.7;
    border-radius: 2px;
}

.download-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

@media (min-width: 576px) {
    .download-links {
        flex-direction: row;
        justify-content: center;
    }
}

.download-links a {
    display: inline-block;
    padding: 14px 24px;
    text-decoration: none;
    width: 100%;
    max-width: 220px;
    text-align: center;
    box-sizing: border-box;
}

.download-links a::before {
    content: "⬇️";
    margin-right: 8px;
}

@media (max-width: 576px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 25px 20px;
        margin: 15px auto;
    }
    
    h1 {
        font-size: 1.9rem;
    }
    
    .description {
        font-size: 1rem;
    }
    
    button#submit-btn {
        max-width: none;
    }
    
    .download-links a {
        max-width: none;
    }
    
    .image-card img {
        height: 180px;
    }
    
    .upload-preview {
        height: 250px;
    }
}

@media (min-width: 577px) {
     .image-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.clipboard-tip {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.clipboard-tip.show {
    opacity: 1;
    visibility: visible;
}

.success-message {
    color: #155724;
    text-align: center;
    margin: 25px auto;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    background-color: var(--success-bg);
    border: 1px solid var(--success-color);
    display: none;
    max-width: 600px;
    font-weight: 500;
}

.file-label {
    display: inline-block;
    padding: 14px 24px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 0;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
    position: relative;
    overflow: hidden;
}

.file-label::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.file-label:hover::after {
    left: 100%;
}

.file-label:hover {
    background-color: var(--primary-color-dark);
    box-shadow: 0 6px 15px rgba(67, 97, 238, 0.4);
    transform: translateY(-3px);
}

.file-label:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(67, 97, 238, 0.3);
}

.file-label span {
    position: relative;
    padding-left: 5px;
}

.file-label span::before {
    content: "⤴";
    margin-right: 8px;
    font-weight: bold;
}


#image-file {
    display: none;
}

.upload-preview img {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    object-fit: contain;
    transition: var(--transition);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    z-index: 1;
    position: relative;
}

.upload-preview img:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.upload-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23f0f0f0' fill-opacity='1' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.2;
    z-index: 0;
}

.upload-preview .paste-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(4px);
    z-index: 2;
}

.upload-preview .preview-text {
    color: #aaa;
    font-style: italic;
    font-size: 1.1rem;
    text-align: center;
    background-color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    position: relative;
    z-index: 1;
}

button#submit-btn:disabled {
    background-color: #adb5bd;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
} 