@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', 'Segoe UI', 'Tahoma', 'Arial', sans-serif !important;
}

body {
    font-family: 'Vazirmatn', 'Segoe UI', 'Tahoma', 'Arial', sans-serif !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    direction: rtl;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.8;
}

h1, h2, h3, h4, h5, h6, p, label, button, input, textarea, span, div, a, li, td, th {
    font-family: 'Vazirmatn', 'Segoe UI', 'Tahoma', 'Arial', sans-serif !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Login Section */
.login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin-top: -20px;
}

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

.login-card h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

/* App Section */
.app-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 30px;
    margin-top: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

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

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-buttons .btn {
    padding: 10px 20px;
    font-size: 14px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.button-group {
    margin: 20px 0;
}

.button-group .btn {
    width: 100%;
    font-size: 18px;
    padding: 15px 30px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input[type="file"] {
    padding: 8px;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

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

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

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
    margin-top: 20px;
}

.btn-success:hover {
    background: #218838;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.upload-section h2 {
    margin-bottom: 20px;
    color: #333;
}

/* Loading Section */
.loading-section {
    text-align: center;
    padding: 40px;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    border: 2px solid #667eea;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Result Section */
.result-section {
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 2px solid #667eea;
}

.result-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.result-info {
    background: white;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.result-info p {
    font-size: 16px;
    color: #555;
}

.result-info strong {
    color: #333;
}

.result-image-container {
    text-align: center;
    margin: 20px 0;
    background: white;
    padding: 20px;
    border-radius: 5px;
}

.result-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Uploaded Image Preview */
.uploaded-image-preview {
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
}

.uploaded-image-preview h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.preview-image-container {
    text-align: center;
    margin-top: 15px;
}

.preview-image-container img {
    max-width: 100%;
    max-height: 400px;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid #ddd;
}

.tiff-loading-indicator {
    text-align: center;
    padding: 20px;
    margin: 10px 0;
}

.tiff-loading-indicator p {
    color: #667eea;
    font-weight: 500;
    margin-top: 10px;
}

/* Error Messages */
.error-message {
    color: #dc3545;
    background: #f8d7da;
    padding: 12px;
    border-radius: 5px;
    margin-top: 10px;
    border: 1px solid #f5c6cb;
}

.error-section {
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .app-section {
        padding: 20px;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
    }

    header h1 {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .login-card {
        padding: 30px 20px;
    }
}

