* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    padding: 40px 20px;
}

.section {
    margin-bottom: 40px;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.section h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5em;
}

/* Upload Section */
.upload-area {
    border: 3px dashed #667eea;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.upload-area:hover {
    background: #f0f0ff;
    border-color: #764ba2;
}

.upload-area p {
    font-size: 1.1em;
    color: #666;
}

.progress {
    margin-top: 20px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress.hidden {
    display: none;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

.status-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    display: none;
}

.status-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Gallery Section */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gallery-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.gallery-item-info {
    padding: 15px;
}

.gallery-item-id {
    font-size: 0.85em;
    color: #666;
    word-break: break-all;
    margin-bottom: 10px;
}

.gallery-item-actions {
    display: flex;
    gap: 10px;
}

.btn-select,
.btn-delete {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.btn-select {
    background: #667eea;
    color: white;
}

.btn-select:hover {
    background: #764ba2;
}

.btn-delete {
    background: #ff6b6b;
    color: white;
}

.btn-delete:hover {
    background: #d63031;
}

/* Transform Section */
.transform-controls {
    background: white;
    padding: 20px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.input-field {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
    transition: border-color 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.transform-result {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    display: none;
}

.transform-result.hidden {
    display: none;
}

.transform-result:not(.hidden) {
    display: block;
}

.transform-result img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    margin: 20px 0;
}

.url-display {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 4px;
    font-size: 0.9em;
    word-break: break-all;
    color: #666;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
}

/* Analysis Section */
.analysis-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.analysis-controls .input-field {
    flex: 1;
}

.analysis-result {
    background: white;
    padding: 20px;
    border-radius: 8px;
    display: none;
}

.analysis-result.hidden {
    display: none;
}

.analysis-result:not(.hidden) {
    display: block;
}

.analysis-result h3 {
    margin-bottom: 15px;
    color: #333;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.info-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    border-left: 3px solid #667eea;
}

.info-item strong {
    color: #667eea;
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.info-item span {
    word-break: break-all;
}

.transformation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.transformation-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.transformation-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.transformation-item-label {
    padding: 10px;
    background: #f9f9f9;
    font-size: 0.9em;
    color: #666;
    text-align: center;
    font-weight: 500;
}

/* Features Section */
.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.feature {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
}

.feature h3 {
    margin-bottom: 10px;
    color: #667eea;
}

.feature p {
    color: #666;
    line-height: 1.6;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Footer */
footer {
    background: #f9f9f9;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #ddd;
    color: #666;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    main {
        padding: 20px;
    }

    .section {
        padding: 20px;
    }

    .transform-controls {
        grid-template-columns: 1fr;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .features-list {
        grid-template-columns: 1fr;
    }
}
