/* Admin Modal Styles */

/* Login Modal Styles */
.admin-login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-in-out;
}

.admin-login-modal {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7);
    border: 1px solid #333;
    animation: slideUp 0.4s ease-out;
}

.admin-login-header {
    background: linear-gradient(135deg, #0f3460, #16213e);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-login-header h2 {
    color: #4ade80;
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-login-header h2 i {
    font-size: 1.8rem;
    color: #22d3ee;
}

.admin-login-body {
    padding: 2rem;
}

.login-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: #e5e7eb;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.admin-password-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #374151;
    border-radius: 10px;
    background: #1f2937;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.admin-password-input:focus {
    outline: none;
    border-color: #4ade80;
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.3);
}

.admin-login-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.admin-login-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.login-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.login-info {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    padding: 1.5rem;
}

.login-info h4 {
    color: #4ade80;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}

.login-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.login-info li {
    color: #d1fae5;
    padding: 0.3rem 0;
    display: flex;
    align-items: center;
}

/* Main Admin Modal */
.admin-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-in-out;
}

.admin-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-modal-content {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    border-radius: 20px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    animation: slideUp 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Visitor Table Styles */
.visitor-count-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, #333, #444);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.visitor-count-header strong {
    color: #fff;
    font-size: 1.1rem;
}

.visitor-count-header small {
    color: #bbb;
    margin-left: 0.5rem;
}

.btn-export-inline, .btn-reload {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-export-inline:hover, .btn-reload:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-2px);
}

.visitor-table {
    width: 100%;
    border-collapse: collapse;
    background: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
}

.visitor-table thead {
    background: linear-gradient(135deg, #444, #555);
}

.visitor-table th {
    padding: 1rem;
    text-align: left;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.visitor-table td {
    padding: 0.75rem 1rem;
    color: #ddd;
    border-bottom: 1px solid #444;
}

.visitor-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.active-visitor {
    background: rgba(76, 175, 80, 0.1) !important;
}

.source-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.source-badge.global {
    background: linear-gradient(45deg, #10b981, #059669);
    color: white;
    animation: pulse 2s infinite;
}

.source-badge.system {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

.source-badge.system {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
}

.no-visitors {
    text-align: center;
    padding: 3rem 1rem;
    color: #888;
}

.no-visitors i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-visitors p {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.no-visitors small {
    font-size: 0.9rem;
    opacity: 0.7;
    display: block;
    margin-bottom: 1.5rem;
}

.admin-modal-header {
    background: linear-gradient(135deg, #000000, #1a1a1a);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.admin-modal-header h2 {
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
}

.admin-modal-header h2 i {
    color: #00ff88;
}

.admin-modal-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.admin-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff4444;
}

.admin-modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Admin Login Styles */
.admin-login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.login-form {
    background: rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: 15px;
    border: 1px solid #333;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-form h3 {
    color: #ffffff;
    margin-bottom: 30px;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    color: #cccccc;
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #444;
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.2);
}

.form-group input::placeholder {
    color: #888;
}

.btn-login {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #00ff88, #00cc6a);
    color: #000000;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    background: linear-gradient(135deg, #00cc6a, #00aa55);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
}

/* Admin Dashboard Styles */
.admin-dashboard {
    color: #ffffff;
}

.admin-tabs {
    display: flex;
    border-bottom: 1px solid #333;
    margin-bottom: 30px;
    gap: 10px;
}

.tab-btn {
    background: none;
    border: none;
    color: #cccccc;
    padding: 15px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.tab-btn.active {
    background: linear-gradient(135deg, #00ff88, #00cc6a);
    color: #000000;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeInTab 0.3s ease-in-out;
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Messages Tab */
.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.messages-header h4 {
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-count {
    background: #00ff88;
    color: #000000;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.messages-list {
    max-height: 400px;
    overflow-y: auto;
}

.message-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.message-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #555;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.message-sender {
    color: #00ff88;
    font-weight: 600;
}

.message-date {
    color: #888;
    font-size: 12px;
}

.message-subject {
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 8px;
}

.message-content {
    color: #cccccc;
    line-height: 1.5;
    margin-bottom: 15px;
}

.message-actions {
    display: flex;
    gap: 10px;
}

.btn-reply {
    background: linear-gradient(135deg, #0088ff, #0066cc);
    color: #ffffff;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.btn-reply:hover {
    background: linear-gradient(135deg, #0066cc, #0055aa);
}

.btn-delete {
    background: linear-gradient(135deg, #ff4444, #cc3333);
    color: #ffffff;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: linear-gradient(135deg, #cc3333, #aa2222);
}

.no-messages {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.no-messages i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Analytics Tab */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.analytics-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.analytics-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #555;
}

.card-icon {
    background: linear-gradient(135deg, #00ff88, #00cc6a);
    color: #000000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.card-content h4 {
    color: #cccccc;
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 500;
}

.card-number {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
}

.card-text {
    color: #ffffff;
    font-size: 14px;
}

/* Settings Tab */
.settings-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
}

.settings-section h4 {
    color: #ffffff;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-action {
    background: linear-gradient(135deg, #0088ff, #0066cc);
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-action:hover {
    background: linear-gradient(135deg, #0066cc, #0055aa);
    transform: translateY(-2px);
}

.btn-action.danger {
    background: linear-gradient(135deg, #ff4444, #cc3333);
}

.btn-action.danger:hover {
    background: linear-gradient(135deg, #cc3333, #aa2222);
}

.admin-info {
    color: #cccccc;
    line-height: 1.8;
}

.admin-info strong {
    color: #ffffff;
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-modal-content {
        width: 95%;
        max-height: 95vh;
        margin: 10px;
    }
    
    .admin-modal-header {
        padding: 15px 20px;
    }
    
    .admin-modal-header h2 {
        font-size: 1.2rem;
    }
    
    .admin-modal-body {
        padding: 20px;
    }
    
    .admin-tabs {
        flex-direction: column;
        gap: 5px;
    }
    
    .tab-btn {
        padding: 12px 15px;
        border-radius: 8px;
        margin-bottom: 5px;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-actions {
        flex-direction: column;
    }
    
    .btn-action {
        width: 100%;
        justify-content: center;
    }
    
    .message-actions {
        flex-direction: column;
    }
    
    .btn-reply,
    .btn-delete {
        width: 100%;
        justify-content: center;
    }
}

/* Visitors Tab Styles */
.visitors-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.visitors-header h4 {
    color: #00ff88;
    margin: 0;
    font-size: 1.2em;
}

.visitors-stats {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
}

.visitor-count {
    color: #00ff88;
    font-weight: 600;
}

.total-visits {
    color: #888;
}

.visitors-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #333;
    color: #ccc;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #00ff88;
}

.filter-btn.active {
    background: linear-gradient(135deg, #00ff88, #00cc6a);
    color: #000;
    border-color: #00ff88;
}

.visitors-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.visitor-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.visitor-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #00ff88;
}

.visitor-item.active {
    border-color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.visitor-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 10px;
}

.visitor-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.visitor-detail label {
    font-size: 0.8em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.visitor-detail span {
    color: #fff;
    font-weight: 500;
}

.visitor-timestamps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #333;
    font-size: 0.85em;
}

.visitor-entry {
    color: #00ff88;
}

.visitor-exit {
    color: #ff6b6b;
}

.visitor-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
}

.visitor-status.active {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
}

.visitor-status.offline {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

.visitors-actions {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #333;
    flex-wrap: wrap;
}

.no-visitors {
    text-align: center;
    color: #666;
    padding: 40px 20px;
}

.no-visitors i {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-visitors p {
    margin: 0;
    font-size: 1.1em;
}

.text-success {
    color: #00ff88 !important;
}

@media (max-width: 768px) {
    .visitor-info {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .visitors-timestamps {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .visitors-actions {
        flex-direction: column;
    }
    
    .visitors-stats {
        flex-direction: column;
        gap: 5px;
        text-align: right;
    }
}

/* Messages Tab Styles */
.messages-header {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid #3b82f6;
}

.messages-header h3 {
    color: #60a5fa;
    margin: 0 0 0.5rem 0;
    font-size: 1.4rem;
}

.messages-header p {
    color: #cbd5e1;
    margin: 0;
    font-size: 0.95rem;
}

.messages-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(59, 130, 246, 0.1);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.message-count {
    color: #60a5fa;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.export-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.export-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
}

.messages-list {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.message-card {
    background: linear-gradient(135deg, #1f2937, #374151);
    border: 1px solid #4b5563;
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.message-card:hover {
    border-color: #60a5fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
}

.message-header {
    background: rgba(59, 130, 246, 0.1);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #4b5563;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.message-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.message-date {
    color: #60a5fa;
    font-weight: 600;
    font-size: 0.95rem;
}

.device-info {
    color: #9ca3af;
    font-size: 0.85rem;
}

.message-id {
    color: #6b7280;
    font-size: 0.8rem;
    font-family: monospace;
}

.message-body {
    padding: 1.5rem;
}

.visitor-details {
    display: grid;
    gap: 0.75rem;
}

.detail-row {
    display: flex;
    color: #d1d5db;
    font-size: 0.9rem;
    line-height: 1.4;
}

.detail-row strong {
    color: #f3f4f6;
    min-width: 140px;
    margin-right: 0.5rem;
}

.no-messages {
    text-align: center;
    padding: 3rem 2rem;
    color: #9ca3af;
}

.no-messages i {
    font-size: 3rem;
    color: #4b5563;
    margin-bottom: 1rem;
}

.no-messages h3 {
    color: #d1d5db;
    margin: 0 0 1rem 0;
}

.no-messages p {
    margin: 0;
    font-size: 0.95rem;
}

@media (max-width: 480px) {
    .admin-modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .login-form {
        padding: 30px 20px;
    }
    
    .messages-stats {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .message-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .detail-row {
        flex-direction: column;
    }
    
    .detail-row strong {
        min-width: auto;
        margin-right: 0;
        margin-bottom: 0.25rem;
    }
}