/* Admin Dashboard Styles for Legal Lands Ghana */

/* Base Admin Layout */
.admin-body {
    display: flex;
    min-height: 100vh;
    background-color: #f8fafc;
    font-family: 'Inter', sans-serif;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid #374151;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #10B981;
}

.logo i {
    margin-right: 10px;
    font-size: 1.8rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 1.5rem;
    color: #d1d5db;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item:hover {
    background-color: #374151;
    color: white;
}

.nav-item.active {
    background-color: #10B981;
    color: white;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: #059669;
}

.nav-item i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
}

.nav-item .badge {
    background-color: #ef4444;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    margin-left: auto;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    border-top: 1px solid #374151;
    padding: 1rem 0;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Admin Header */
.admin-header {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.sidebar-toggle:hover {
    background-color: #f3f4f6;
}

#pageTitle {
    font-size: 1.8rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #10B981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: #1f2937;
}

.user-role {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Content Sections */
.content-section {
    display: none;
    padding: 2rem;
    flex: 1;
}

.content-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #10B981, #059669);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
}

.stat-content p {
    color: #6b7280;
    margin: 0;
    font-size: 0.875rem;
}

/* Dashboard Charts */
.dashboard-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.chart-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.activity-list,
.performance-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item,
.performance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
}

.activity-item .time {
    font-size: 0.875rem;
    color: #6b7280;
}

.performance-item .metric {
    font-weight: 600;
    color: #10B981;
}

/* Listings Table */
.listings-filter {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-select {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-size: 0.875rem;
}

.listings-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.listings-table table {
    width: 100%;
    border-collapse: collapse;
}

.listings-table th {
    background: #f9fafb;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.listings-table td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.listings-table tr:hover {
    background: #f9fafb;
}

.property-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.property-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.property-details h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.25rem 0;
}

.property-details p {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-available {
    background: #dcfce7;
    color: #166534;
}

.status-reserved {
    background: #fef3c7;
    color: #92400e;
}

.status-sold {
    background: #fee2e2;
    color: #991b1b;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 6px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.btn-edit {
    background: #dbeafe;
    color: #1d4ed8;
}

.btn-edit:hover {
    background: #bfdbfe;
}

.btn-delete {
    background: #fee2e2;
    color: #dc2626;
}

.btn-delete:hover {
    background: #fecaca;
}

/* Forms */
.listing-form,
.profile-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #10B981;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.image-upload {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.3s ease;
    cursor: pointer;
}

.image-upload:hover {
    border-color: #10B981;
}

.upload-placeholder i {
    font-size: 3rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.upload-placeholder p {
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.upload-placeholder span {
    font-size: 0.875rem;
    color: #9ca3af;
}

.image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.preview-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.875rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Inquiries */
.inquiries-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.inquiry-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #10B981;
}

.inquiry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.inquiry-info h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.25rem 0;
}

.inquiry-info p {
    color: #6b7280;
    margin: 0;
    font-size: 0.875rem;
}

.inquiry-meta {
    text-align: right;
    font-size: 0.875rem;
    color: #6b7280;
}

.inquiry-content {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
}

.inquiry-actions {
    display: flex;
    gap: 1rem;
}

/* Analytics */
.analytics-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.chart-placeholder {
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
}

.chart-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Password Section */
.password-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.password-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.password-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 400px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dashboard-charts,
    .analytics-overview {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .listings-table {
        overflow-x: auto;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .inquiry-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .inquiry-actions {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .content-section {
        padding: 1rem;
    }
    
    .admin-header {
        padding: 1rem;
    }
    
    .listing-form,
    .profile-form {
        padding: 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .image-preview {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #10B981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success/Error Messages */
.message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.message.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.message.warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ============================================
   ROLE-BASED ACCESS & SECURITY STYLES
   ============================================ */

/* Verification Banner */
.verification-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-bottom: 1px solid #f59e0b;
    color: #92400e;
    font-size: 0.95rem;
}

.verification-banner i {
    font-size: 1.2rem;
}

.verification-banner .btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    background: #f59e0b;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.verification-banner .btn-small:hover {
    background: #d97706;
}

.verification-banner .close-banner {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #92400e;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
}

.verification-banner .close-banner:hover {
    color: #78350f;
}

/* Owner Badge Styles */
.owner-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.owner-badge.verified {
    background: #d1fae5;
    color: #047857;
}

.owner-badge.unverified {
    background: #fef3c7;
    color: #d97706;
}

.owner-badge i {
    font-size: 0.75rem;
}

/* Enhanced Security Indicators */
.security-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.security-indicator.secure {
    background: #d1fae5;
    color: #047857;
}

.security-indicator.warning {
    background: #fef3c7;
    color: #d97706;
}

/* Session Timer Display */
.session-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #6b7280;
    padding: 4px 8px;
    background: #f3f4f6;
    border-radius: 4px;
}

.session-timer.warning {
    background: #fef3c7;
    color: #d97706;
}

.session-timer i {
    font-size: 0.75rem;
}

/* Auto-save indicator */
.auto-save-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 10px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #6b7280;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.auto-save-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

.auto-save-indicator i {
    color: #10B981;
}

/* Form Draft Indicator */
.draft-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #dbeafe;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #1d4ed8;
}

.draft-indicator button {
    margin-left: auto;
    padding: 6px 12px;
    background: #1d4ed8;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.draft-indicator button:hover {
    background: #1e40af;
}

/* Responsive adjustments for security elements */
@media (max-width: 768px) {
    .verification-banner {
        flex-wrap: wrap;
        text-align: center;
        justify-content: center;
    }
    
    .verification-banner span {
        flex-basis: 100%;
        margin-bottom: 10px;
    }
    
    .verification-banner .close-banner {
        position: absolute;
        top: 8px;
        right: 8px;
    }
}

