* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: #1a1a1a;
    min-height: 100vh;
    padding: 0;
    color: #e0e0e0;
}

/* 상단 정보 바 */
.top-info {
    background: #2a2a2a;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3a3a3a;
}

.filename-display {
    font-size: 0.9em;
    color: #b0b0b0;
    font-weight: 500;
}

.provider-info {
    font-size: 0.85em;
    color: #888;
    font-style: italic;
}

.container {
    max-width: 100%;
    margin: 0;
    background: transparent;
    min-height: calc(100vh - 50px);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    padding: 20px;
    height: calc(100vh - 50px);
}

@media (max-width: 1400px) {
    .main-content {
        grid-template-columns: 1fr;
        height: auto;
    }
}

.section {
    background: #252525;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid #3a3a3a;
    overflow-y: auto;
    max-height: calc(100vh - 90px);
}

.section-left {
    border-left: 3px solid #4a9eff;
}

.section-center {
    border-left: 3px solid #ff6b9d;
}

.section-right {
    border-left: 3px solid #6b9eff;
}

.section-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3a3a3a;
}

.upload-area {
    border: 2px dashed #4a9eff;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    background: #2a2a2a;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: #6b9eff;
    background: #2f2f2f;
}

.upload-area.dragover {
    border-color: #6b9eff;
    background: #333;
    transform: scale(1.01);
}

.upload-icon {
    font-size: 3em;
    color: #4a9eff;
    margin-bottom: 15px;
}

.upload-text {
    font-size: 1em;
    color: #b0b0b0;
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 0.85em;
    color: #888;
}

#fileInput {
    display: none;
}

.usage-hint {
    margin-bottom: 12px;
    padding: 10px;
    background: #2a2a2a;
    border-radius: 8px;
    font-size: 0.85em;
    color: #b0b0b0;
    border-left: 3px solid #4a9eff;
}

.image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.result-label {
    font-size: 0.85em;
    color: #b0b0b0;
    margin-bottom: 8px;
    font-weight: 500;
}

.image-viewer-container {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    background: #1a1a1a;
    cursor: grab;
    border: 1px solid #3a3a3a;
}

.placeholder {
    width: 100%;
    height: 300px;
    background: #1a1a1a;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    border: 1px solid #3a3a3a;
}

.viewer-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    transition: transform 0.1s;
    user-select: none;
}

.analyze-button {
    width: 100%;
    padding: 14px;
    margin-top: 20px;
    background: linear-gradient(135deg, #4a9eff 0%, #6b9eff 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.3);
}

.analyze-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.5);
}

.analyze-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.results-section {
    display: none;
}

.results-section.active {
    display: block;
}

.result-card {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid #3a3a3a;
}

.result-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
}

.result-value {
    font-size: 2.2em;
    font-weight: 700;
    color: #4a9eff;
}

.section-center .result-value {
    color: #ff6b9d;
}

.section-right .result-value {
    color: #6b9eff;
}

.result-unit {
    font-size: 1em;
    color: #888;
}

.result-detail {
    font-size: 1em;
    color: #b0b0b0;
    margin-top: 8px;
    margin-bottom: 12px;
}

.info-badge {
    display: inline-block;
    padding: 6px 12px;
    background: #2a2a2a;
    color: #888;
    border-radius: 16px;
    font-size: 0.85em;
    margin-top: 8px;
    border: 1px solid #3a3a3a;
}

.similarity-display {
    margin-top: 15px;
    padding: 10px;
    background: #2a2a2a;
    border-radius: 8px;
    font-size: 0.9em;
    color: #b0b0b0;
    border-left: 3px solid #ffa500;
}

.gradcam-section {
    margin-top: 20px;
}

.result-viewer {
    height: 350px;
    margin-top: 10px;
}

.loading {
    display: none;
    text-align: center;
    padding: 30px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 3px solid #3a3a3a;
    border-top: 3px solid #4a9eff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1em;
    color: #b0b0b0;
    font-weight: 500;
}

.error-message {
    display: none;
    padding: 12px;
    background: #3a1a1a;
    color: #ff6b6b;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #ff6b6b;
    font-size: 0.9em;
}

.error-message.active {
    display: block;
}
