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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    /* Your New Dark Background */
    background: linear-gradient(135deg, #2c3e50 0%, #000000 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 12px;
    /* Softened the shadow for the dark background */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 800px;
    padding: 40px;
    margin: 0 auto;
}

h1 {
    color: #2c3e50; /* Darker slate for text */
    font-size: 28px;
}

h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 20px;
}

button {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn {
    /* Updated to match the slate theme */
    background: #4a5568;
    color: white;
    padding: 8px 15px;
    font-size: 14px;
    width: 100%;
    margin-top: 10px;
}

.copy-btn:hover {
    background: #2d3748;
}

.metadata {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.metadata.show {
    display: block;
}

.metadata-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.metadata-item:last-child {
    border-bottom: none;
}

.metadata-label {
    color: #718096;
    font-weight: 600;
}

.metadata-value {
    color: #2d3748;
}

.url-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #edf2f7;
    padding: 10px 12px;
    border-radius: 8px;
    word-break: break-all;
}

.url-box a {
    flex: 1;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
}

.url-box a:hover {
    color: #3182ce;
    text-decoration: underline;
}

/* index.html specific */
h1 {
    margin-bottom: 30px;
    text-align: center;
}

.upload-section {
    margin-bottom: 30px;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

input[type="file"] {
    display: none;
}

.file-input-label {
    display: block;
    padding: 40px;
    /* Border changed from purple to Slate */
    border: 2px dashed #4a5568;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.file-input-label:hover {
    border-color: #2c3e50;
    background: #f1f5f9;
}

.file-input-label.dragover {
    border-color: #2c3e50;
    background: #e2e8f0;
}

.file-input-label p {
    color: #4a5568;
    font-weight: 500;
    margin-bottom: 8px;
}

.file-input-label small {
    color: #94a3b8;
}

#fileName {
    color: #2c3e50;
    font-weight: 600;
    margin-top: 10px;
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

#uploadBtn {
    /* Gradient adapted to Dark Slate/Steel Grey */
    background: linear-gradient(135deg, #4a5568 0%, #2c3e50 100%);
    color: white;
    flex: 1;
}

#uploadBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(44, 62, 80, 0.3);
}

#uploadBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#clearBtn {
    background: #e2e8f0;
    color: #4a5568;
    padding: 12px 20px;
}

#clearBtn:hover {
    background: #cbd5e1;
}

.result-section {
    display: none;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #edf2f7;
}

.result-section.show {
    display: block;
}

.image-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.image-preview.show {
    display: block;
}


.status {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none;
    text-align: center;
    font-weight: 500;
}

.status.show {
    display: block;
}

.status.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.status.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status.loading {
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #bae6fd;
}

/* view.html specific */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.back-btn {
    background: #e2e8f0;
    color: #4a5568;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #cbd5e1;
}

.url-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #edf2f7;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.url-card label {
    display: block;
    color: #718096;
    font-size: 11px;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    color: #718096;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.copy-btn-icon:hover {
    color: #2c3e50;
    background: #e2e8f0;
}

.copy-btn-icon .icon-check {
    display: none;
}

.copy-btn-icon.copied .icon-copy {
    display: none;
}

.copy-btn-icon.copied .icon-check {
    display: block;
}

.copy-btn-icon.copied {
    color: #10b981;
    background: #d1fae5;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.error.show {
    display: block;
}

.loading {
    text-align: center;
    color: #4a5568;
    font-weight: 600;
    padding: 40px;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 24px;
    }

    .file-input-label {
        padding: 30px 20px;
    }

    .header {
        flex-direction: column;
        gap: 15px;
    }

    .back-btn {
        width: 100%;
    }

    .metadata-item {
        flex-direction: column;
    }

    .metadata-value {
        text-align: left;
        margin-left: 0;
        margin-top: 5px;
    }
}