/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Login Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    color: #764ba2;
    margin-bottom: 10px;
    font-size: 28px;
    text-align: center;
}

.login-box h2 {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
    text-align: center;
    font-weight: normal;
}

.login-box input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e4e8;
    border-radius: 5px;
    font-size: 16px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.login-box input[type="password"]:focus {
    outline: none;
    border-color: #764ba2;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.login-box button:hover {
    transform: translateY(-2px);
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: white;
    border-radius: 10px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #764ba2;
    font-size: 28px;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-info span {
    color: #666;
    font-size: 14px;
}

.logout-btn {
    background: #f44336;
    color: white;
    padding: 8px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #d32f2f;
}

/* Instructions */
.instructions {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.instructions p {
    margin-bottom: 10px;
    color: #555;
    line-height: 1.6;
}

.instructions p:last-child {
    margin-bottom: 0;
}

/* Error Messages */
.error-message, .error-alert {
    background: #ffebee;
    color: #c62828;
    padding: 12px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #c62828;
}

/* Upload Section */
.upload-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.upload-box {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.upload-box h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    position: relative;
    transition: all 0.3s;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area.dragover {
    border-color: #764ba2;
    background: #f8f9ff;
}

.upload-area.has-image {
    border-style: solid;
    border-color: #764ba2;
    padding: 10px;
}

.upload-area input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: #999;
    pointer-events: none;
}

.upload-label svg {
    color: #764ba2;
}

.upload-label span {
    font-size: 16px;
    color: #666;
}

.upload-label small {
    font-size: 12px;
    color: #999;
}

.preview {
    display: none;
    width: 100%;
    height: 100%;
}

.upload-area.has-image .upload-label {
    display: none;
}

.upload-area.has-image .preview {
    display: block;
}

.preview img {
    max-width: 100%;
    max-height: 380px;
    object-fit: contain;
    border-radius: 5px;
}

.image-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #666;
    display: none;
}

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

.image-info div {
    margin-bottom: 5px;
}

/* Button Section */
.button-section {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

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

button[type="submit"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

button[type="submit"]:disabled {
    background: #ccc;
    cursor: not-allowed;
}

button[type="submit"]:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(118, 75, 162, 0.4);
}

button[type="button"] {
    background: #f5f5f5;
    color: #666;
}

button[type="button"]:hover {
    background: #e0e0e0;
}

/* Results Section */
.results-section {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.results-section h2 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 24px;
}

.similarity-score {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    border-radius: 10px;
}

.similarity-score.different-enough {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
}

.similarity-score.too-similar {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
}

.score-value {
    font-size: 72px;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.score-label {
    font-size: 18px;
    color: white;
    margin-top: 10px;
}

.verdict {
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 16px;
}

.verdict-pass {
    background: #e8f5e9;
    color: #2e7d32;
    border: 2px solid #4caf50;
}

.verdict-fail {
    background: #ffebee;
    color: #c62828;
    border: 2px solid #f44336;
}

.verdict-icon {
    font-size: 30px;
    font-weight: bold;
}

/* Detailed Results */
.detailed-results {
    margin-bottom: 30px;
}

.detailed-results h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
}

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

.metric {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-label {
    color: #666;
    font-size: 14px;
}

.metric-value {
    font-weight: bold;
    color: #333;
    font-size: 18px;
}

/* Difference Visualization */
.difference-visualization {
    text-align: center;
    margin-bottom: 30px;
}

.difference-visualization h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
}

.difference-visualization img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.viz-note {
    margin-top: 15px;
    color: #666;
    font-size: 14px;
    font-style: italic;
}

/* Analysis Notes */
.analysis-notes {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.analysis-notes h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 20px;
}

.analysis-notes ul {
    list-style: none;
    padding: 0;
}

.analysis-notes li {
    padding: 10px 0;
    padding-left: 25px;
    position: relative;
    color: #555;
    line-height: 1.6;
}

.analysis-notes li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #764ba2;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .upload-section {
        grid-template-columns: 1fr;
    }
    
    .metric-grid {
        grid-template-columns: 1fr;
    }
    
    header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .header-info {
        flex-direction: column;
    }
    
    .similarity-score .score-value {
        font-size: 48px;
    }
}