/* Admin Panel Styles */

.admin-body {
    background: #f8f9fa;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    margin-bottom: 2rem;
    text-align: center;
    color: #333;
}

.back-home {
    text-align: center;
    margin-top: 1.5rem;
}

.back-home a {
    color: #01411C;
    text-decoration: none;
}

/* Admin Header */
.admin-header {
    background: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-logo h1 {
    font-size: 1.5rem;
}

.admin-header nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.admin-header nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.admin-header nav a:hover {
    opacity: 0.8;
}

/* Admin Container */
.admin-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 20px;
}

.admin-container h2 {
    margin-bottom: 2rem;
    color: #333;
}

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

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-icon {
    font-size: 3rem;
}

.stat-info h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.stat-info p {
    color: #666;
    margin: 0;
}

.stat-pending {
    border-left: 4px solid #ffc107;
}

/* Recent Section */
.recent-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.recent-section h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

/* Filters Section */
.filters-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.admin-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

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

.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

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

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.3s;
}

.btn-edit {
    background: #007bff;
    color: white;
}

.btn-edit:hover {
    background: #0056b3;
}

.btn-view {
    background: #17a2b8;
    color: white;
}

.btn-view:hover {
    background: #117a8b;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

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

/* Bulk Actions */
.bulk-actions {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.bulk-actions select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
}

/* View All Button */
.view-all {
    text-align: center;
    margin-top: 2rem;
}

/* Admin Form */
.admin-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f8f9fa;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.form-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
}

.permalink-display {
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-family: monospace;
    color: #495057;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Admin Grid */
.admin-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
}

.admin-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.admin-card h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

/* Status badges for inactive */
.status-inactive {
    background: #e9ecef;
    color: #6c757d;
}

/* Pending Badge */
.pending-badge {
    background: #ff9800;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

/* Correction Requests */
.requests-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.request-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-left: 4px solid #ddd;
}

.request-card.status-pending {
    border-left-color: #ff9800;
}

.request-card.status-approved {
    border-left-color: #4caf50;
    opacity: 0.7;
}

.request-card.status-rejected {
    border-left-color: #f44336;
    opacity: 0.7;
}

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.request-header h3 {
    margin: 0 0 0.5rem 0;
}

.request-header h3 a {
    color: #01411C;
    text-decoration: none;
}

.doctor-info {
    color: #666;
    margin: 0;
}

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

.request-details {
    margin-bottom: 1.5rem;
}

.correction-item {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.correction-compare {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.old-value {
    color: #dc3545;
    text-decoration: line-through;
    opacity: 0.7;
}

.new-value {
    color: #28a745;
    font-weight: 600;
}

.arrow {
    color: #666;
    font-size: 1.2rem;
}

.requester-info {
    padding: 1rem;
    background: #e3f2fd;
    border-radius: 8px;
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.requester-info span {
    background: white;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
}

.additional-notes {
    padding: 1rem;
    background: #fff3cd;
    border-radius: 8px;
    margin: 1rem 0;
}

.request-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #f0f0f0;
}

.btn-approve {
    background: #28a745;
    color: white;
}

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

/* Contact Messages */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.message-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-left: 4px solid #ddd;
}

.message-card.status-unread {
    border-left-color: #ff9800;
    background: #fffaf0;
}

.message-card.status-read {
    border-left-color: #2196f3;
    opacity: 0.9;
}

.message-card.status-replied {
    border-left-color: #4caf50;
    opacity: 0.8;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.message-header h3 {
    margin: 0 0 0.5rem 0;
}

.message-meta {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.message-status-info {
    text-align: right;
}

.message-content {
    margin-bottom: 1.5rem;
}

.subject-line {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.message-text {
    padding: 1rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    line-height: 1.6;
}

.admin-notes-display {
    padding: 1rem;
    background: #e3f2fd;
    border-radius: 8px;
    margin: 1rem 0;
}

.message-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 2px solid #f0f0f0;
}

.notes-form {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.notes-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-family: inherit;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .admin-header .container {
        flex-direction: column;
        padding: 1rem;
    }
    
    .admin-header nav ul {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .admin-header nav ul li {
        width: 100%;
    }
    
    .admin-header nav ul li a {
        display: block;
        padding: 0.75rem;
        text-align: center;
        background: rgba(255,255,255,0.1);
        border-radius: 6px;
    }
    
    .admin-container {
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .page-header h2 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        font-size: 0.85rem;
        min-width: 600px;
    }
    
    table th,
    table td {
        padding: 0.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .action-buttons .btn-action {
        width: 100%;
        text-align: center;
    }
    
    .bulk-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .bulk-actions select,
    .bulk-actions button {
        width: 100%;
    }
    
    .admin-filters {
        flex-direction: column;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button,
    .form-actions a {
        width: 100%;
        text-align: center;
    }
    
    .btn-action {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
    
    .request-card,
    .message-card {
        padding: 1rem;
    }
    
    .request-header,
    .message-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .request-meta,
    .message-status-info {
        margin-top: 0.5rem;
        text-align: left;
    }
    
    .request-actions,
    .message-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .request-actions .btn-action,
    .message-actions .btn-action {
        width: 100%;
        justify-content: center;
    }
    
    .correction-item {
        padding: 0.75rem;
    }
    
    .correction-compare {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .old-value,
    .new-value {
        display: block;
        width: 100%;
    }
    
    .arrow {
        transform: rotate(90deg);
        margin: 0.25rem 0;
    }
    
    .requester-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .requester-info span {
        width: 100%;
    }
    
    .subject-line,
    .message-text {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
    
    .admin-card {
        padding: 1rem;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

/* Extra small devices (phones in portrait, less than 480px) */
@media (max-width: 480px) {
    .admin-container {
        padding: 0.5rem;
    }
    
    .page-header h2 {
        font-size: 1.3rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card h3 {
        font-size: 1.8rem;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-submit,
    .btn-action {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }
    
    .request-card,
    .message-card {
        padding: 0.75rem;
    }
    
    .status-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    table {
        font-size: 0.8rem;
    }
    
    .admin-card h3 {
        font-size: 1.2rem;
    }
}
