/* Xavier PHP Login Script - Main Stylesheet */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Navbar Styling */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Card Enhancements */
.card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: none;
    border-radius: 8px;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Button Styling */
.btn {
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Form Styling */
.form-control {
    border-radius: 6px;
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Alert Styling */
.alert {
    border-radius: 8px;
    border: none;
}

/* Badge Styling */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* Table Styling */
.table {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.table thead th {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

/* Footer */
footer {
    margin-top: auto;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* Sidebar (Admin) */
.sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

.sidebar .nav-link {
    color: var(--text-primary);
    padding: 12px 20px;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
    background-color: var(--bg-hover);
    border-left-color: var(--primary-color);
}

.sidebar .nav-link.active {
    background-color: var(--bg-tertiary);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .sidebar {
        position: relative;
        top: 0;
    }
    
    .table {
        font-size: 0.875rem;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* User Avatar */
.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.user-avatar-md {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.user-avatar-lg {
    width: 128px;
    height: 128px;
    border-radius: 50%;
}

/* Forum Specific Styles */
.forum-category {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.topic-row {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.topic-row:hover {
    background-color: var(--bg-hover);
}

.topic-row:last-child {
    border-bottom: none;
}

.sticky-topic {
    background-color: rgba(245, 158, 11, 0.1);
    border-left: 3px solid var(--warning);
}

.locked-topic {
    opacity: 0.7;
}

/* Post Styling */
.post-author {
    background-color: var(--bg-tertiary);
    padding: 15px;
    border-radius: 8px;
    color: var(--text-primary);
}

.post-content {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 20px;
    border-radius: 8px;
    min-height: 100px;
}

.post-signature {
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    margin-top: 10px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Utility Classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* User Profile Link Styles */
.user-profile-link {
    display: flex !important;
    align-items: center;
    gap: 10px;
    position: relative;
    padding: 8px 15px !important;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.user-profile-link:hover {
    background: var(--bg-secondary) !important;
}

.user-avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    border: 2px solid var(--primary-color);
}

.username-display {
    font-weight: 600;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Message Badge Styles */
.message-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
    border: 2px solid var(--bg-primary);
    z-index: 10;
    pointer-events: none; /* Allow clicks through badge */
}

.notification-badge.pulse,
.message-badge.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Hide username on mobile */
@media (max-width: 768px) {
    .username-display {
        display: none;
    }
}

/* Print Styles */
@media print {
    .navbar, .sidebar, .btn, footer {
        display: none;
    }
}