* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    color: #fff;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin-bottom: 30px;
}

.back-link {
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    transition: background 0.3s ease;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Login Section */
.login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-box {
    background: rgba(0, 0, 0, 0.6);
    padding: 40px;
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 16px;
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-login:hover {
    background: #45a049;
}

.error-message {
    color: #ff6b6b;
    text-align: center;
    margin-top: 15px;
    min-height: 20px;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.btn-logout {
    padding: 10px 20px;
    background: #f44336;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-logout:hover {
    background: #da190b;
}

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

.stat-card {
    background: rgba(0, 0, 0, 0.4);
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card i {
    font-size: 2.5rem;
    color: #77aaff;
    margin-bottom: 15px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    color: #aaa;
    font-size: 0.9rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 25px;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.tab-btn:hover {
    background: rgba(119, 170, 255, 0.6);
}

.tab-btn.active {
    background: #77aaff;
}

.tab-content {
    display: none;
}

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

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.btn-refresh {
    padding: 8px 15px;
    background: #77aaff;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-refresh:hover {
    background: #5599ee;
}

/* Messages List */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-item {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #77aaff;
}

.message-item.unread {
    border-left-color: #4CAF50;
    background: rgba(76, 175, 80, 0.15);
}

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

.message-name {
    font-weight: bold;
    color: #77aaff;
    font-size: 1.2rem;
}

.message-email {
    color: #aaa;
}

.message-date {
    color: #888;
    font-size: 0.9rem;
}

.message-subject {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.message-body {
    color: #ddd;
    line-height: 1.6;
    margin-bottom: 10px;
    white-space: pre-wrap;
}

.message-meta {
    color: #888;
    font-size: 0.9rem;
}

/* Visitors List */
.visitors-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.visitor-item {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 10px;
}

.visitor-info {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.visitor-ip,
.visitor-location {
    color: #77aaff;
}

.visitor-details {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    color: #aaa;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.visitor-agent {
    color: #888;
    font-size: 0.85rem;
    word-break: break-all;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #aaa;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tabs {
        flex-direction: column;
    }

    .tab-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .message-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-password {
    padding: 10px 20px;
    background: #ff9800;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-password:hover {
    background: #f57c00;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header h3 {
    margin: 0;
    color: #fff;
}

.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    color: #ff6b6b;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #fff;
    font-weight: bold;
}

.form-group label i {
    margin-right: 8px;
    color: #77aaff;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #77aaff;
}

.error-message {
    color: #ff6b6b;
    margin: 10px 0;
    min-height: 20px;
    font-size: 14px;
}

.success-message {
    color: #4CAF50;
    margin: 10px 0;
    min-height: 20px;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-cancel {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

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

.btn-submit-password {
    flex: 1;
    padding: 12px;
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-submit-password:hover {
    background: #45a049;
}

.password-requirements {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.password-requirements h4 {
    margin: 0 0 10px 0;
    color: #77aaff;
    font-size: 14px;
}

.password-requirements ul {
    margin: 0;
    padding-left: 20px;
    color: #aaa;
    font-size: 13px;
}

.password-requirements li {
    margin-bottom: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-password,
    .btn-logout {
        width: 100%;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}

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

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

.time-item {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #ff9800;
}

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

.time-page {
    font-weight: bold;
    color: #77aaff;
    word-break: break-all;
}

.time-duration {
    color: #ff9800;
    font-size: 1.2rem;
    font-weight: bold;
}

.time-details {
    color: #aaa;
    font-size: 0.9rem;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
/* Tab Actions */
.tab-actions {
    display: flex;
    gap: 10px;
}

.btn-delete-all {
    background: #f44336;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-delete-all:hover {
    background: #da190b;
}

/* Message Item with Delete Button */
.message-item {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #77aaff;
    position: relative;
    margin-bottom: 15px;
}

.message-item.unread {
    border-left-color: #4CAF50;
    background: rgba(76, 175, 80, 0.15);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
    padding-right: 60px;
}

.message-actions {
    position: absolute;
    top: 20px;
    right: 20px;
}

.btn-delete-message {
    background: rgba(244, 67, 54, 0.8);
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
}

.btn-delete-message:hover {
    background: #f44336;
}

.message-body {
    color: #ddd;
    line-height: 1.6;
    margin-bottom: 10px;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
    word-break: break-word;
}

/* Better Analytics Cards */
.analytics-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.time-item {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #ff9800;
    position: relative;
}

.time-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
    padding-right: 60px;
}

.time-page {
    font-weight: bold;
    color: #77aaff;
    word-break: break-all;
    flex: 1;
    font-size: 14px;
}

.time-duration {
    color: #ff9800;
    font-size: 1.2rem;
    font-weight: bold;
    white-space: nowrap;
}

.time-details {
    color: #aaa;
    font-size: 0.9rem;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.time-actions {
    position: absolute;
    top: 20px;
    right: 20px;
}

.btn-delete-time {
    background: rgba(244, 67, 54, 0.8);
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
}

.btn-delete-time:hover {
    background: #f44336;
}

/* Character limit indicator */
.char-limit {
    font-size: 12px;
    color: #aaa;
    text-align: right;
    margin-top: 5px;
}

.char-limit.warning {
    color: #ff9800;
}

.char-limit.exceeded {
    color: #f44336;
}
/* Visitor Actions */
.visitor-actions {
    margin-top: 10px;
    text-align: right;
}

.visitor-actions .btn-delete-message {
    background: rgba(244, 67, 54, 0.8);
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
}

.visitor-actions .btn-delete-message:hover {
    background: #f44336;
}