/* ===========================
   سامانه گزارش خاموشی Mini App - CSS
   =========================== */

:root {
    --primary: #ff6b35;
    --secondary: #004e89;
    --success: #4caf50;
    --danger: #f44336;
    --warning: #ff9800;
    --light: #f5f5f5;
    --dark: #333;
    --border: #ddd;
}

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

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5f5f5;
    color: var(--dark);
    direction: rtl;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/static/Vazirmatn.woff2') format('woff2');
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--warning) 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.logo {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.logo-text h1 {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 5px;
}

.logo-text p {
    font-size: 12px;
    opacity: 0.9;
}

.content {
    padding: 20px;
    min-height: calc(100vh - 120px);
}

.screen {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: block;
}

.hidden {
    display: none !important;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #e55a2a;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

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

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

.full-width {
    width: 100%;
}

.btn-back {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
}

/* Auth Screen */
.welcome-box {
    background: white;
    padding: 40px 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.welcome-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 20px;
}

.welcome-box h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--dark);
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.welcome-box p {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin-bottom: 10px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(255, 107, 53, 0.2);
}

/* Menu */
.menu-container {
    padding: 20px 0;
}

.menu-welcome {
    background: linear-gradient(135deg, var(--primary) 0%, var(--warning) 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
}

.menu-welcome h2 {
    font-size: 24px;
    margin-bottom: 5px;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: right;
}

.menu-btn:hover {
    background: var(--light);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateX(-5px);
}

.menu-btn-icon {
    font-size: 32px;
    color: var(--primary);
    min-width: 50px;
    display: flex;
    justify-content: center;
}

.menu-btn-text h3 {
    font-size: 16px;
    margin-bottom: 5px;
    color: var(--dark);
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.menu-btn-text p {
    font-size: 12px;
    color: #666;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Form */
.form-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
}

.form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.form-header h2 {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.step-indicator {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: space-between;
}

.step {
    flex: 1;
    padding: 8px;
    background: #e0e0e0;
    border-radius: 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.step.active {
    background: var(--primary);
    color: white;
}

.step-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.step-content.active {
    display: block !important;
}

.step-content h3 {
    margin-bottom: 10px;
    color: var(--dark);
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.step-content p {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Location Map */
#location-map {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1;
}

.geo-button {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 400 !important;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    padding: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: var(--primary) !important;
    color: white !important;
    border: none !important;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    font-weight: bold;
}

.geo-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

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

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.category-btn {
    padding: 15px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: right;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 600;
}

.category-btn:hover {
    border-color: var(--primary);
    background: rgba(255, 107, 53, 0.05);
}

.category-btn.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Media Upload */
.media-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.media-item {
    position: relative;
    width: 100%;
    height: 100px;
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    object-fit: cover;
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-upload-area {
    border: 2px dashed var(--primary);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 107, 53, 0.05);
}

.file-upload-area:hover {
    background: rgba(255, 107, 53, 0.1);
    border-color: #e55a2a;
}

.file-upload-area i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 10px;
    display: block;
}

.file-upload-area p {
    color: #666;
    font-size: 14px;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Status */
.status-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
}

#status-content {
    margin-top: 20px;
}

.status-info {
    background: var(--light);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.status-info h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.status-info p {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--success);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.pending {
    background: var(--warning);
}

.status-badge.closed {
    background: #999;
}

/* Help */
.help-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
}

.help-content h2 {
    margin-bottom: 20px;
    color: var(--dark);
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.help-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.help-item:last-child {
    border-bottom: none;
}

.help-item h3 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 16px;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.help-item p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease-in;
}

.modal.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 40px 20px;
    border-radius: 12px;
    max-width: 400px;
    text-align: center;
}

.modal-content h2 {
    margin: 20px 0 10px 0;
    color: var(--dark);
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.modal-content p {
    color: #666;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Loading */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-screen p {
    color: #666;
    font-size: 14px;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Responsive */
@media (max-width: 400px) {
    .app-container {
        margin: 0;
    }

    .step-indicator {
        flex-direction: column;
    }

    .step {
        padding: 10px;
    }

    .logo-container {
        flex-direction: column;
    }

    .menu-btn {
        flex-direction: column;
        text-align: center;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 5px;
}

.success {
    color: var(--success);
    font-size: 12px;
    margin-top: 5px;
}
