/* Admin Panel Styles */

/* Admin Login Page */
.admin-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 50px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 100%;
    animation: slideUp 0.4s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #333;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.login-form {
    margin-top: 30px;
}

.btn-block {
    width: 100%;
}

.login-footer {
    margin-top: 30px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.text-muted {
    color: #999;
    font-size: 12px;
}

/* Admin Header */
.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.admin-logo h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.admin-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-weight: 500;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.3s ease;
    font-weight: 500;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Admin Body */
.admin-body {
    background: #f5f7fa;
    min-height: 100vh;
    padding-bottom: 40px;
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}

.admin-content {
    width: 100%;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header h1 {
    margin: 0;
    font-size: 32px;
    color: #333;
}

.subtitle {
    color: #666;
    font-size: 16px;
    margin: 5px 0 0 0;
}

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

.card h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #333;
}

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

.card-header h2 {
    margin: 0;
}

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    font-size: 48px;
    line-height: 1;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-primary .stat-value { color: #667eea; }
.stat-success .stat-value { color: #10b981; }
.stat-warning .stat-value { color: #f59e0b; }
.stat-info .stat-value { color: #3b82f6; }

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
}

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

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

.text-center {
    text-align: center;
    color: #999;
    padding: 40px !important;
}

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

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #f3f4f6;
    color: #6b7280;
}

/* Buttons */
.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.btn-link:hover {
    color: #5568d3;
    text-decoration: underline;
}

/* Filters */
.filter-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-select {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

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

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #f0f0f0;
}

.page-info {
    color: #666;
    font-weight: 500;
}

/* Detail View */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

.detail-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-item {
    display: flex;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.detail-item.full-width {
    flex-direction: column;
    gap: 8px;
}

.detail-label {
    font-weight: 600;
    color: #666;
    min-width: 150px;
    font-size: 14px;
}

.detail-value {
    color: #333;
    flex: 1;
    font-size: 14px;
}

.text-content {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    line-height: 1.6;
}

.text-content.small {
    font-size: 12px;
    color: #666;
}

/* Complaint Images */
.complaint-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.complaint-image:hover {
    transform: scale(1.02);
}

.thumbnail-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
}

/* Email Source Display */
.email-source-container {
    position: relative;
}

.email-source {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.6;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Breakdown List */
.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.breakdown-label {
    font-weight: 500;
    color: #333;
}

.breakdown-value {
    font-weight: 700;
    color: #667eea;
    font-size: 18px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .admin-nav {
        width: 100%;
        flex-direction: column;
    }
    
    .nav-link {
        width: 100%;
        text-align: center;
    }
    
    .admin-container {
        padding: 15px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-form {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
    
    .card {
        padding: 20px;
    }
    
    .login-card {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .admin-logo h2 {
        font-size: 18px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .stat-icon {
        font-size: 36px;
    }
}

