/* aprreport/assets/css/app.css - Material Design style */

:root {
    /* Material Design Colors */
    --primary: #1f87f0;
    --primary-dark: #1565c0;
    --secondary: #26a69a;
    --accent: #ff5252;
    --success: hsl(107, 49%, 64%);
    --info: #2196f3;
    --warning: #ff9800;
    --danger: #f44336;
    --light: #f5f5f5;
    --dark: #212121;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border: #e0e0e0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 3px 6px rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.12);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15), 0 3px 6px rgba(0,0,0,0.1);
}

/* Global body style */
body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background-color: #fafafa;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: var(--text-primary);
}

html, body {
    height: 100%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--dark);
    margin-bottom: 1rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p, span, div {
    color: var(--text-primary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Card component with elevation */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    color: var(--dark);
    font-weight: 500;
}

.card-text {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Stat card specific */
.stat-card {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 1rem 0;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.95;
    letter-spacing: 0.5px;
}

/* Form styling */
input, textarea, select {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    border-radius: 4px;
    border: 1px solid var(--border);
    padding: 0.75rem;
    transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 135, 240, 0.1);
    outline: none;
}

input::placeholder, textarea::placeholder {
    color: var(--text-secondary);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Buttons */
.btn {
    min-width: 80px;
    border-radius: 4px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: #00897b;
    box-shadow: var(--shadow-md);
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #43a047;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #e53935;
}

.btn-warning {
    background-color: var(--warning);
    color: white;
}

.btn-warning:hover {
    background-color: #f57c00;
}

.btn-outline-primary {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: white;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.125rem;
}

/* Alerts */
.alert {
    margin-bottom: 1.5rem;
    border: none;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    animation: slideIn 0.3s ease-out;
}

.alert-success {
    background-color: #e8f5e9;
    color: #1b5e20;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background-color: #ffebee;
    color: #b71c1c;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background-color: #fff3e0;
    color: #e65100;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background-color: #e3f2fd;
    color: #0d47a1;
    border-left: 4px solid var(--info);
}



/* باز شدن منو از سمت درست در موبایل (RTL) */
@media (max-width: 768px) {
    body[dir="rtl"] .navbar-collapse {
        text-align: right;
    }
}



/* Whiteboard */
.whiteboard-container {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

#whiteboardMessages {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.whiteboard-message {
    background-color: #f5f5f5;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--primary);
    animation: slideIn 0.3s ease-out;
    transition: all 0.3s ease;
}

.whiteboard-message:hover {
    background-color: #eeeeee;
    box-shadow: var(--shadow-sm);
}

.whiteboard-user {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

.whiteboard-time {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Comments section */
.comments-section {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.comment {
    background: white;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--secondary);
    box-shadow: var(--shadow-sm);
}

.comment-author {
    font-weight: 600;
    color: var(--secondary);
    font-size: 0.95rem;
}

.comment-date {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.comment-text {
    margin-top: 0.5rem;
    color: var(--text-primary);
}

/* Modal */
.modal-content {
    border: none;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 8px 8px 0 0;
}

/* Tables */
.table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: #f5f5f5;
    border: none;
    font-weight: 600;
    color: var(--dark);
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.table tbody tr:hover {
    background-color: #fafafa;
}

/* Pagination */
.pagination {
    margin-top: 1.5rem;
}

.page-link {
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Images */
.img-thumbnail {
    border: none;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    padding: 0;
}

img.img-fluid {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* Responsive design */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1.5rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fade-in { animation: fadeIn 0.5s ease-in; }
.spin { animation: spin 1s linear infinite; }

/* Loading spinner */
.spinner {
    border: 3px solid var(--light);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

/* Utility classes */
.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-muted { color: #999; }

.bg-light { background-color: var(--light); }
.bg-primary { background-color: var(--primary); color: white; }
.bg-secondary { background-color: var(--secondary); color: white; }

.m-0 { margin: 0; }
.m-1 { margin: 0.5rem; }
.m-2 { margin: 1rem; }
.m-3 { margin: 1.5rem; }
.m-4 { margin: 2rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.rounded { border-radius: 6px; }
.rounded-lg { border-radius: 8px; }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* RTL support */
body[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

body[dir="rtl"] .whiteboard-message {
    border-left: none;
    border-right: 4px solid var(--primary);
}

body[dir="rtl"] .comment {
    border-left: none;
    border-right: 3px solid var(--secondary);
}

/* Fix for second modal focus issue */
#editCommentModal .modal-dialog {
    z-index: 99999 !important;
}

.modal-backdrop.show {
    z-index: 1024 !important;
}

/* متن کوتاه‌شونده آخرین گزارش */
#lastReportText {
    transition: max-height 0.3s ease;
}

/* لایت‌باکس حرفه‌ای */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lightbox-modal.show {
    display: flex;
}

.lightbox-modal img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 8px;
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.lightbox-modal img.zoomed {
    transform: scale(1.8);
    cursor: zoom-out;
}

/* Mobile: show only + instead of report title */
@media (max-width: 768px) {
    .report-title {
        display: none !important;
    }
    .report-mobile-toggle {
        font-size: 1.6rem;
        font-weight: bold;
        color: var(--primary);
        display: inline-block;
        margin-left: 4px;
    }
    
/* لایت‌باکس */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lightbox-modal.show {
    display: flex;
}

/* ظرف داخلی */
.lightbox-inner {
    max-width: 100%;
    max-height: 100%;
    overflow: auto; /* فقط این اسکرول می‌شود */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* تصویر */
.lightbox-inner img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    transition: transform 0.25s ease;
    cursor: zoom-in;
}

/* حالت زوم */
.lightbox-inner img.zoomed {
    transform: scale(2.5);
    cursor: zoom-out;
    transform-origin: center center;
}

/* نسخه موبایل */
@media (max-width: 768px) {

    .lightbox-inner {
        overflow: scroll;
        padding: 0;
    }

    .lightbox-inner img {
        max-width: 100%;
        max-height: none;
    }

    .lightbox-inner img.zoomed {
        transform: scale(2.8);
        transform-origin: top center;
    }
}



			