/* Main CSS for KindOfParadox */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.15s ease-in-out;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #f8f9fa;
}

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

.navbar-nav .nav-link {
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

/* Main content wrapper */
main {
    min-height: calc(100vh - 120px);
}

/* Chat specific styles */
.chat-container {
    height: 70vh;
    display: flex;
    flex-direction: column;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    max-height: 400px;
}

.chat-message {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    word-wrap: break-word;
}

.chat-message.own {
    background-color: var(--primary-color);
    color: white;
    margin-left: auto;
    margin-right: 0;
    max-width: 70%;
    text-align: right;
}

.chat-message.other {
    background-color: var(--light-color);
    color: var(--dark-color);
    margin-left: 0;
    margin-right: auto;
    max-width: 70%;
}

.chat-message .username {
    font-weight: bold;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.chat-message .timestamp {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.chat-input-container {
    padding: 1rem;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-top: none;
}

.chat-input {
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
}

.chat-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Room list styles */
.room-list {
    max-height: 300px;
    overflow-y: auto;
}

.room-item {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    transition: var(--transition);
}

.room-item:hover {
    background-color: var(--light-color);
}

.room-item.active {
    background-color: var(--primary-color);
    color: white;
}

.room-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.room-description {
    font-size: 0.875rem;
    opacity: 0.8;
}

.room-member-count {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* User management styles */
.user-card {
    transition: var(--transition);
    border: 1px solid #dee2e6;
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}



.user-role-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
}

.role-super-admin {
    background-color: var(--danger-color);
    color: white;
}

.role-admin {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.role-user {
    background-color: var(--success-color);
    color: white;
}

.role-guest {
    background-color: var(--secondary-color);
    color: white;
}

/* Profile styles */
.profile-header {
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: white;
    padding: 2rem 0;
}

.profile-stats {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: -1rem;
    box-shadow: var(--box-shadow);
}

.stat-item {
    text-align: center;
    padding: 1rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Form styles */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.form-text {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* Button styles */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Card styles */
.card {
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: var(--light-color);
    border-bottom: 1px solid #dee2e6;
    font-weight: 500;
}

/* Alert styles */
.alert {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow);
}

.alert-dismissible .btn-close {
    padding: 0.75rem 1rem;
}

/* Table styles */
.table {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.table th {
    background-color: var(--light-color);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: var(--dark-color);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Status indicators */
.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-online {
    background-color: var(--success-color);
}

.status-offline {
    background-color: var(--secondary-color);
}

.status-away {
    background-color: var(--warning-color);
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Dashboard styles */
.dashboard-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
}

.dashboard-metric {
    text-align: center;
    padding: 1rem;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.metric-label {
    color: var(--secondary-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Footer */
footer {
    margin-top: auto;
}

footer .list-unstyled a {
    text-decoration: none;
    transition: var(--transition);
}

footer .list-unstyled a:hover {
    color: var(--primary-color) !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .chat-container {
        height: 60vh;
    }

    .chat-message.own,
    .chat-message.other {
        max-width: 85%;
    }


    .profile-stats {
        margin-top: 0;
    }

    .metric-value {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .chat-container {
        height: 50vh;
    }

    .dashboard-card {
        padding: 1rem;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-in-out;
}

/* Utility classes */
.text-muted {
    color: var(--secondary-color) !important;
}

.border-radius {
    border-radius: var(--border-radius) !important;
}

.box-shadow {
    box-shadow: var(--box-shadow) !important;
}

.cursor-pointer {
    cursor: pointer;
}

.user-select-none {
    user-select: none;
}

/* Print styles */
@media print {
    .navbar,
    footer,
    .btn,
    .alert {
        display: none !important;
    }

    .container {
        max-width: none !important;
    }

    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #212529;
        --dark-color: #ffffff;
    }

    body {
        background-color: #121212;
        color: #ffffff;
    }

    .card,
    .table,
    .chat-messages,
    .chat-input-container {
        background-color: #1e1e1e;
        border-color: #444;
    }

    .table th {
        background-color: #2d2d2d;
    }

    .chat-message.other {
        background-color: #2d2d2d;
        color: #ffffff;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border-width: 2px;
    }

    .card {
        border-width: 2px;
    }
}

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