/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

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

/* Main content */
main {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Form styles */
.document-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-weight: 600;
    color: #555;
    font-size: 0.95rem;
}

select, textarea {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

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

textarea {
    resize: vertical;
    min-height: 120px;
}

small {
    color: #666;
    font-size: 0.85rem;
}

/* Button styles */
.form-actions {
    margin-top: 20px;
}

.btn-primary, .btn-secondary, .btn-outline {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

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

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #28a745;
    color: white;
    margin-right: 10px;
}

.btn-secondary:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

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

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

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

/* Result and error sections */
.result-section, .error-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 30px;
    margin-top: 30px;
    border-left: 4px solid #28a745;
}

.error-section {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.result-section h3 {
    color: #28a745;
    margin-bottom: 20px;
}

.error-section h3 {
    color: #dc3545;
    margin-bottom: 15px;
}

.result-content {
    margin-bottom: 25px;
}

.result-content p {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.result-content strong {
    color: #555;
    display: inline-block;
    width: 120px;
}

.result-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 25px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .btn-secondary, .btn-outline {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* File upload styles */
.file-upload-container {
    position: relative;
    margin-bottom: 10px;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px dashed #e1e5e9;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 80px;
}

.file-label:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.file-label.dragover {
    border-color: #667eea;
    background: #e8ebff;
    transform: scale(1.02);
}

.file-icon {
    font-size: 1.5rem;
    margin-right: 10px;
}

.file-text {
    color: #666;
    font-size: 0.95rem;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #e8f5e8;
    border: 1px solid #28a745;
    border-radius: 6px;
    margin-top: 10px;
}

.file-name {
    color: #155724;
    font-weight: 500;
    flex: 1;
}

.remove-file {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 5px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.remove-file:hover {
    background: rgba(220, 53, 69, 0.1);
}

/* Update existing file input when file is selected */
.file-input:not(:placeholder-shown) + .file-label {
    border-color: #28a745;
    background: #f8fff8;
}

.file-input:not(:placeholder-shown) + .file-label .file-text {
    color: #28a745;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Success animation */
.result-section {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Authentication styles */
.login-form {
    max-width: 1400px;
    width: 100%;
    margin: 2rem auto;
    padding: 2rem 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-form .form-group {
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 1700px;
}

.login-form label {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.login-form input {
    width: 100%;
    padding: 1.5rem 1rem;
    font-size: 1.4rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
}

.login-form button {
    width: 100%;
    max-width: 1000px;
    padding: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.logout-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

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

.error-message {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 1rem;
}

header {
    position: relative;
}
