/* ====================================================== */
/* ADMIN DASHBOARD STYLES */
/* ====================================================== */

:root {
    --primary-color: #1f2937;
    --secondary-color: #fafaff;
    --accent-color: #f97316;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-dark: #0f172a;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #1f2937;
    --text-secondary: #64748b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ====================================================== */
/* LOGIN SECTION */
/* ====================================================== */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #f8f7f8 100%);
    padding: 2rem;
}

.login-box {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 3rem;
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.login-header h1 {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login-btn {
    padding: 0.875rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-error {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 0.875rem;
    border-radius: 8px;
    font-size: 0.9rem;
    border-left: 4px solid #dc2626;
    display: none;
}

/* ====================================================== */
/* DASHBOARD SECTION */
/* ====================================================== */

.dashboard-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-light);
}

/* Dashboard Navbar */
.dashboard-navbar {
    background: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dashboard-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.navbar-left h2 {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.logout-btn {
    padding: 0.625rem 1.25rem;
    background-color: var(--danger-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
}

/* Dashboard Content */
.dashboard-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 1.875rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.message-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--secondary-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
}

/* Messages Container */
.messages-container {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.no-messages {
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.no-messages p {
    color: var(--text-secondary);
}

/* Messages Table */
.messages-data-table {
    width: 100%;
    border-collapse: collapse;
}

.messages-data-table thead {
    background-color: #f1f5f9;
    border-bottom: 2px solid var(--border-color);
}

.messages-data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.messages-data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.messages-data-table tbody tr {
    transition: all 0.2s ease;
}

.messages-data-table tbody tr:hover {
    background-color: #f8fafc;
}

.even-row {
    background-color: white;
}

.odd-row {
    background-color: #f9fafb;
}

/* Table Cells */
.name-cell {
    font-weight: 600;
    color: var(--primary-color);
}

.email-cell {
    color: var(--secondary-color);
}

.phone-cell {
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
}

.message-cell {
    max-width: 300px;
}

.message-preview {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    word-break: break-word;
}

.date-cell {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.action-cell {
    text-align: center;
}

/* Buttons */
.view-more-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 0.5rem;
}

.view-more-btn:hover {
    background-color: #4f46e5;
    transform: scale(1.05);
}

.delete-btn {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background-color: #dc2626;
    transform: scale(1.05);
}

/* ====================================================== */
/* RESPONSIVE DESIGN */
/* ====================================================== */

@media (max-width: 768px) {
    .login-box {
        padding: 2rem;
    }
    
    .dashboard-content {
        padding: 1rem;
    }
    
    .dashboard-header h1 {
        font-size: 1.5rem;
    }
    
    .navbar-content {
        padding: 0 1rem;
    }
    
    .navbar-left h2 {
        display: none;
    }
    
    .messages-data-table {
        font-size: 0.8rem;
    }
    
    .messages-data-table th,
    .messages-data-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .message-cell {
        max-width: 150px;
    }
    
    .view-more-btn,
    .delete-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .message-preview {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 1rem;
    }
    
    .login-box {
        padding: 1.5rem;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .messages-data-table {
        font-size: 0.7rem;
    }
    
    .messages-data-table th,
    .messages-data-table td {
        padding: 0.5rem 0.25rem;
    }
    
    .dashboard-navbar {
        padding: 1rem 0.5rem;
    }
}

/* ====================================================== */
/* ANIMATIONS */
/* ====================================================== */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ====================================================== */
/* ACCESSIBILITY */
/* ====================================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for keyboard navigation */
button:focus,
input:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .dashboard-navbar,
    .logout-btn {
        display: none;
    }
    
    .messages-container {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}
