/* admin/css/admin.css - Clean Version */

:root {
    --primary: #1e3c72;
    --secondary: #2a5298;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --dark: #343a40;
    --light: #f8f9fa;
    --text-dark: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --shadow: 0 5px 20px rgba(0,0,0,0.05);
    --shadow-hover: 0 10px 30px rgba(0,0,0,0.1);
    --radius: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f4f6f9;
    color: var(--text-dark);
}

/* Admin Container */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
}

/* Content Wrapper */
.content-wrapper {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger {
    padding: 10px 20px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--light);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.9rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--light);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-light);
}

.data-table tr:hover {
    background: var(--light);
}

/* Actions */
.actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s;
}

.action-btn.edit {
    background: var(--warning);
    color: var(--text-dark);
}

.action-btn.delete {
    background: var(--danger);
    color: white;
}

.action-btn.view {
    background: var(--info);
    color: white;
}

.action-btn.reply {
    background: var(--success);
    color: white;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Status Badges */
.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
}

.status-badge.unread {
    background: #fff3cd;
    color: #856404;
}

.status-badge.read {
    background: #cce5ff;
    color: #004085;
}

.status-badge.replied {
    background: #d4edda;
    color: #155724;
}

.status-badge.success {
    background: #d4edda;
    color: #155724;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

/* Forms */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.admin-form {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group.checkbox {
    display: flex;
    align-items: center;
}

.form-group.checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.form-group.checkbox input {
    width: auto;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 10px;
}

.filter-tab {
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-light);
    background: var(--light);
    transition: all 0.3s;
}

.filter-tab:hover,
.filter-tab.active {
    background: var(--primary);
    color: white;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue {
    background: #cce5ff;
    color: #004085;
}

.stat-icon.green {
    background: #d4edda;
    color: #155724;
}

.stat-icon.purple {
    background: #e2d5f8;
    color: #6f42c1;
}

.stat-icon.orange {
    background: #fff3cd;
    color: #856404;
}

.stat-details h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.stat-details p {
    color: var(--text-light);
    margin: 5px 0 0;
}

/* Recent Section */
.recent-section {
    margin-top: 30px;
}

.recent-section h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--text-dark);
}

/* Login Page */
.login-page {
    background: #0b1a3a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    padding: 20px;
}

.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.login-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.18), transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(236, 72, 153, 0.14), transparent 40%),
        radial-gradient(circle at 70% 85%, rgba(56, 189, 248, 0.16), transparent 45%),
        linear-gradient(160deg, #0b1a3a 0%, #12264f 55%, #0d1f45 100%);
}

.login-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    animation: orbFloat 12s ease-in-out infinite;
}

.login-bg-orb-1 {
    width: 320px;
    height: 320px;
    background: rgba(99, 102, 241, 0.35);
    top: -80px;
    left: -80px;
}

.login-bg-orb-2 {
    width: 260px;
    height: 260px;
    background: rgba(236, 72, 153, 0.28);
    bottom: -60px;
    right: -70px;
    animation-delay: -4s;
}

.login-bg-orb-3 {
    width: 180px;
    height: 180px;
    background: rgba(56, 189, 248, 0.30);
    top: 55%;
    left: 70%;
    animation-delay: -8s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.1); }
}

.login-container {
    width: 100%;
    max-width: 410px;
    z-index: 1;
}

.login-box {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 44px 40px 36px;
    box-shadow: 0 30px 80px rgba(2, 8, 22, 0.55);
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.login-plane {
    position: absolute;
    top: -22px;
    right: 34px;
    width: 44px;
    height: 44px;
    border: none;
    cursor: pointer;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.4);
    transition: transform 0.3s ease;
}

.login-plane:hover {
    transform: translateY(-3px) rotate(-8deg);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.login-brand i {
    font-size: 2rem;
    color: #4f46e5;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.18);
}

.login-logo h2 {
    font-size: 1.9rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
    color: #0b1a3a;
}

.login-logo h2 span {
    background: linear-gradient(135deg, #4f46e5, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

.login-logo p {
    color: #64748b;
    margin: 10px 0 0;
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.login-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 22px 0 0;
}

.login-divider span {
    width: 54px;
    height: 4px;
    border-radius: 6px;
    background: linear-gradient(90deg, #4f46e5, #ec4899);
}

.login-form .form-group {
    position: relative;
    margin-bottom: 20px;
}

.login-form .form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}

.login-form .form-group label i {
    color: #4f46e5;
    font-size: 0.8rem;
}

.input-wrap {
    position: relative;
}

.input-wrap .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: #94a3b8;
    transition: color 0.3s;
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    padding: 13px 44px 13px 42px;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    color: #0f172a;
    background: #f8fafc;
    transition: all 0.3s;
}

.input-wrap input:focus {
    outline: none;
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

.input-wrap input:focus ~ .input-icon,
.input-wrap input:focus + .toggle-pw ~ .input-icon {
    color: #4f46e5;
}

.toggle-pw {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.toggle-pw:hover {
    color: #4f46e5;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
    margin-top: 6px;
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.35);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(99, 102, 241, 0.45);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn.loading {
    opacity: 0.8;
    cursor: progress;
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid #eef2f7;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 500;
}

.login-footer i {
    color: #22c55e;
    font-size: 0.85rem;
}

@media (max-width: 480px) {
    .login-box {
        padding: 36px 26px 28px;
    }
}

/* ---- 3D & Animated Enhancements ---- */
.login-grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.9), transparent 75%);
    mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.9), transparent 75%);
    animation: gridMove 18s linear infinite;
}

@keyframes gridMove {
    from { background-position: 0 0; }
    to   { background-position: 46px 46px; }
}

.login-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.lpart {
    position: absolute;
    bottom: -10px;
    background: rgba(147, 197, 253, 0.55);
    border-radius: 50%;
    animation: particleRise linear infinite;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
}

@keyframes particleRise {
    0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
    8%   { opacity: 0.7; }
    85%  { opacity: 0.5; }
    100% { transform: translateY(-110vh) translateX(50px) scale(0.4); opacity: 0; }
}

.login-ring {
    position: absolute;
    border: 1px solid rgba(147, 197, 253, 0.18);
    border-radius: 50%;
    pointer-events: none;
}

.login-ring-1 { width: 480px; height: 480px; top: -160px; right: -120px; animation: spin 26s linear infinite; border-top-color: rgba(99,102,241,0.5); }
.login-ring-2 { width: 620px; height: 620px; bottom: -240px; left: -160px; animation: spin 40s linear infinite reverse; border-right-color: rgba(236,72,153,0.4); }
.login-ring-3 { width: 220px; height: 220px; top: 62%; left: -60px; animation: spin 20s linear infinite; border-bottom-color: rgba(56,189,248,0.5); }

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.tilt-scene {
    perspective: 1200px;
}

.login-box {
    transform-style: preserve-3d;
    transition: box-shadow 0.4s ease;
    will-change: transform;
}

.login-box:hover {
    box-shadow: 0 40px 90px rgba(2, 8, 22, 0.65);
}

.login-title, .login-logo h2, .login-btn, .login-plane {
    transform: translateZ(30px);
}

.box-shine {
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,0.45), transparent);
    transform: skewX(-20deg);
    animation: shineSlide 5.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shineSlide {
    0%, 60% { left: -75%; }
    100%    { left: 130%; }
}

.brand-icon-wrap {
    position: relative;
    width: 62px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border-radius: 18px;
    box-shadow: 0 12px 26px rgba(99, 102, 241, 0.28), inset 0 -3px 8px rgba(79,70,229,0.10);
    animation: bounceSlow 3.6s ease-in-out infinite;
    border: 1px solid rgba(99, 102, 241, 0.18);
}

@keyframes bounceSlow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    30%      { transform: translateY(-5px) rotate(-3deg); }
    60%      { transform: translateY(0) rotate(2deg); }
}

.brand-icon {
    font-size: 1.65rem;
    color: #4f46e5;
}

.brand-emoji {
    position: absolute;
    right: -6px;
    bottom: -6px;
    font-size: 0.85rem;
    color: #fff;
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(236, 72, 153, 0.4);
}

.login-planen .login-plane {
    transition: transform 0.3s ease;
}

.input-wrap.focus .input-icon {
    color: #4f46e5;
}

.input-wrap.focus input {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

@media (prefers-reduced-motion: reduce) {
    .login-bg-orb, .login-ring, .lpart, .box-shine, .brand-icon-wrap { animation: none; }
}

/* Footer */
.admin-footer {
    margin-left: 260px;
    padding: 20px 30px;
    text-align: center;
}

.footer-content {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .admin-footer {
        margin-left: 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .filter-tabs {
        flex-wrap: wrap;
    }
}
/* Search box */
.search-box {
    position: relative;
    display: inline-block;
}

.search-box input {
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    width: 250px;
    transition: all 0.3s;
}

.search-box input:focus {
    width: 300px;
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30,60,114,0.1);
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

/* Image preview */
.image-preview {
    margin-top: 10px;
}

.image-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 5px;
    border: 2px solid var(--border-color);
    padding: 5px;
}

/* Table header with search */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 500px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-dark);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

.close-modal:hover {
    color: var(--danger);
}