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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #3b5bdb 0%, #4c7cff 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 18px;
    box-shadow: 0 30px 75px rgba(12, 20, 49, 0.25);
    padding: 50px;
    max-width: 1400px;
    width: 100%;
}

.page-header {
    margin-bottom: 35px;
}

.page-header h1 {
    color: #192457;
    margin-bottom: 10px;
    font-size: 32px;
    text-align: left;
}

.page-header p {
    color: #4a5686;
    font-size: 16px;
    line-height: 1.5;
}

.app-layout {
    display: grid;
    grid-template-columns: minmax(450px, 380px) minmax(0, 1fr);
    gap: 30px;
    align-items: flex-start;
}

.upload-card,
.status-panel {
    border-radius: 16px;
    padding: 30px;
    background: white;
}

.upload-card {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 20px 35px rgba(59, 91, 219, 0.25);
}

.status-panel {
    background: #e8eaef;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 15px 30px rgba(0, 0, 0, 0.08);
    color: #3a3f52;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.status-panel h2 {
    margin-bottom: 12px;
    color: #2a2f42;
    font-size: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #d8dce5;
    border-top-color: #3b5bdb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.spinner.active {
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.success-checkmark {
    width: 24px;
    height: 24px;
    background: #2d7a3e;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.success-checkmark.active {
    display: flex;
}

.status-intro {
    font-size: 15px;
    color: #5a6170;
    margin-bottom: 20px;
    line-height: 1.4;
}

.status-content {
    flex: 1;
    background: #f5f6fa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #d8dce5;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
    color: #3a3f52;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 500px;
}

.log-message {
    margin: 4px 0;
}

.log-message.normal {
    color: #5a6170;
}

.log-message.success {
    color: #2d7a3e;
    font-weight: 500;
}

.log-message.error {
    color: #c92a2a;
    font-weight: 500;
}

.log-message.warning {
    color: darkorange;
    font-weight: 500;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 28px;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 10px;
    color: #555;
    font-weight: 500;
}

.file-name {
    margin-top: 8px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
    color: #2a3f5f;
    font-weight: 500;
    min-height: 20px;
    word-break: break-word;
}

.file-name:empty {
    display: none;
}

input[type="file"] {
    display: block;
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.3s;
}

input[type="file"]:hover {
    border-color: #2a5298;
}

input[type="file"]:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #3b5bdb 0%, #4c7cff 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(59, 91, 219, 0.4);
}

button:active {
    transform: translateY(0);
}

.message {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 6px;
    text-align: left;
    font-weight: 500;
    white-space: pre-line;
}

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

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

.message.hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
    display: none;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #3b5bdb 0%, #4c7cff 100%);
    width: 0%;
    transition: width 0.3s;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


@media (max-width: 1100px) {
    body {
        padding: 30px 20px;
    }

    .container {
        padding: 35px;
    }

    .app-layout {
        grid-template-columns: 1fr;
    }
}

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

.login-container .center {
    color: #333;
    text-align: center;
}

.center h1 {
    font-size: 28px;
    margin-bottom: 0;
}

.center h2 {
    font-size: 22px;
    margin-bottom: 30px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.login-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

.logout-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: white;
    border-radius: 10px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 22px;
}

.modal-icon {
    font-size: 28px;
}

.modal-body {
    margin-bottom: 25px;
    color: #555;
    line-height: 1.6;
}

.duplicate-details {
    background: #f8f9fa;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.duplicate-details p {
    margin: 5px 0;
    font-size: 14px;
}

.duplicate-details strong {
    color: #333;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn-cancel {
    background: #e0e0e0;
    color: #333;
}

.modal-btn-cancel:hover {
    background: #d0d0d0;
}

.modal-btn-confirm {
    background: linear-gradient(135deg, #3b5bdb 0%, #4c7cff 100%);
    color: white;
}

.modal-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(59, 91, 219, 0.4);
}
