/* 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-color: #f4f4f4;
}

.container {
    max-width: 80%;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.navbar-brand {
    flex-shrink: 0;
}

.navbar-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    display: inline-block;
    transition: color 0.3s;
}

.navbar-brand a:hover {
    color: #667eea;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.navbar-menu a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    transition: all 0.3s;
    white-space: nowrap;
    font-size: 0.95rem;
}

.navbar-menu a:hover {
    background-color: #34495e;
    transform: translateY(-2px);
}

.navbar-menu a:active {
    transform: translateY(0);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 30px 0;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 20px;
}

.card-header {
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.card-header h2 {
    color: #2c3e50;
    font-size: 1.8rem;
}

.card-body {
    padding: 10px 0;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.stat-card.green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-card.blue {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card.orange {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-card h3 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    opacity: 0.8;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

.form-check {
    margin-bottom: 10px;
}

.form-check input[type="checkbox"] {
    margin-right: 8px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
}

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

.btn-primary:hover {
    background-color: #5568d3;
}

.btn-success {
    background-color: #38ef7d;
    color: white;
}

.btn-success:hover {
    background-color: #2dd46d;
}

.btn-danger {
    background-color: #ff6b6b;
    color: white;
}

.btn-danger:hover {
    background-color: #ee5a52;
}

.btn-warning {
    background-color: #feca57;
    color: #333;
}

.btn-warning:hover {
    background-color: #f5b942;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table thead {
    background-color: #2c3e50;
    color: white;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

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

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

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background-color: #38ef7d;
    color: white;
}

.badge-danger {
    background-color: #ff6b6b;
    color: white;
}

.badge-warning {
    background-color: #feca57;
    color: #333;
}

.badge-info {
    background-color: #4facfe;
    color: white;
}

.badge-secondary {
    background-color: #95a5a6;
    color: white;
}

/* Login/Register Forms */
.auth-container {
    max-width: 450px;
    margin: 50px auto;
}

.auth-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 40px;
}

.auth-card h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

/* Footer */
.footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 20px 0;
}

.pagination li {
    margin: 0 5px;
}

.pagination a {
    display: block;
    padding: 8px 12px;
    background-color: white;
    color: #667eea;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.pagination a:hover {
    background-color: #667eea;
    color: white;
}

.pagination .active a {
    background-color: #667eea;
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 0;
}

.modal-content {
    background-color: white;
    margin: 0 auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: calc(100vh - 40px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-body {
    padding: 20px 30px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    max-height: calc(100vh - 120px);
}

.modal-content form {
    padding: 20px 30px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    max-height: calc(100vh - 120px);
}

/* Custom scrollbar for modals */
.modal-body::-webkit-scrollbar,
.modal-content form::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track,
.modal-content form::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb,
.modal-content form::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover,
.modal-content form::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.modal-close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    line-height: 1;
    transition: color 0.3s;
    flex-shrink: 0;
}

.modal-close:hover {
    color: #333;
}

/* Ensure form buttons stay visible */
.modal-content form .btn {
    margin-top: 10px;
}

/* Fix for Jodit editor in modals */
.modal-content .jodit-container {
    margin-bottom: 15px;
}

.modal-content .jodit-workplace {
    min-height: 300px !important;
    max-height: 400px !important;
}

/* Ensure pre and code blocks in modals are scrollable */
.modal-body pre,
.modal-content pre {
    overflow-x: auto;
    max-width: 100%;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.modal-body textarea,
.modal-content textarea {
    max-width: 100%;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.float-right {
    float: right;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Loading Spinner */
.loader {
    text-align: center;
    padding: 40px;
    color: #667eea;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 9999;
    display: none;
    min-width: 250px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin: 8px 0;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin: 12px 0;
}

.skeleton-card {
    height: 120px;
    margin: 10px 0;
}

/* Fade animations */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-out {
    animation: fadeOut 0.3s ease;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Pulse animation for stats */
.stat-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Quick action buttons */
.quick-action-btn {
    display: inline-block;
    padding: 6px 12px;
    margin: 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.quick-action-btn:hover {
    transform: scale(1.05);
}

.quick-action-btn.approve {
    background: #38ef7d;
    color: white;
}

.quick-action-btn.reject {
    background: #ff6b6b;
    color: white;
}

/* Live indicator */
.live-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #38ef7d;
    border-radius: 50%;
    margin-right: 5px;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* Search highlight */
.search-highlight {
    background: #feca57;
    padding: 2px 4px;
    border-radius: 2px;
}

/* Tooltip */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #2c3e50;
    color: white;
    border-radius: 4px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

/* Image preview */
.image-preview {
    max-width: 300px;
    margin-top: 10px;
    border: 1px solid #ddd;
    padding: 5px;
    border-radius: 4px;
}

/* Smooth transitions */
.smooth-transition {
    transition: all 0.3s ease;
}

/* Card hover effect */
.card.interactive {
    cursor: pointer;
    transition: all 0.3s ease;
}

.card.interactive:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Status indicators */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-dot.active {
    background: #38ef7d;
}

.status-dot.pending {
    background: #feca57;
}

.status-dot.inactive {
    background: #95a5a6;
}

.status-dot.error {
    background: #ff6b6b;
}

/* Responsive */
@media (max-width: 992px) {
    .navbar .container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .navbar-brand {
        margin-bottom: 10px;
    }
    
    .navbar-menu {
        width: 100%;
        flex-direction: column;
        gap: 0;
    }
    
    .navbar-menu a {
        width: 100%;
        text-align: left;
        padding: 10px 15px;
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .navbar-menu a:last-child {
        border-bottom: none;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 0.875rem;
        display: block;
        overflow-x: auto;
    }
    
    .table th,
    .table td {
        padding: 8px;
        white-space: nowrap;
    }
    
    .auth-container {
        margin: 20px auto;
    }
    
    .auth-card {
        padding: 30px 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .navbar-brand a {
        font-size: 1.2rem;
    }
    
    .navbar-menu a {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
    
    .stat-card .stat-value {
        font-size: 2rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}
