/* Improbable Remains - Custom Styles */

:root {
    --primary-color: #0d6efd;
    --dark-color: #212529;
    --light-color: #f8f9fa;
}

/* Global Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
}

main {
    margin: 0;
    padding: 0;
}

/* Navigation */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

/* Cards */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
}

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

/* Character Cards (for game interface) */
.character-card {
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s;
}

.character-card:hover {
    border-color: var(--primary-color);
}

.character-card.selected {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.1);
}

.character-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* Chat/Message Interface */
.message-container {
    height: 500px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    background-color: #f8f9fa;
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    max-width: 80%;
}

.message.player {
    background-color: #e7f3ff;
    margin-left: auto;
    text-align: right;
}

.message.character {
    background-color: white;
    border: 1px solid #dee2e6;
}

.message-author {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.message-content {
    margin: 0;
}

.message-time {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Room Code Display */
.room-code {
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    letter-spacing: 0.5em;
    font-weight: bold;
    color: var(--primary-color);
}

/* Player List */
.player-list {
    list-style: none;
    padding: 0;
}

.player-list li {
    padding: 0.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.player-list li:last-child {
    border-bottom: none;
}

.player-badge {
    font-size: 0.75rem;
}

/* Evidence List */
.evidence-item {
    cursor: pointer;
    transition: background-color 0.2s;
}

.evidence-item:hover {
    background-color: #f8f9fa;
}

.evidence-item.hidden {
    opacity: 0.5;
    font-style: italic;
}

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

/* Game Status Indicators */
.status-waiting {
    color: #ffc107;
}

.status-active {
    color: #198754;
}

.status-completed {
    color: #6c757d;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    /* Typography */
    body {
        font-size: 15px;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    /* Room code */
    .room-code {
        font-size: 1.2rem;
        letter-spacing: 0.3em;
    }

    /* Character cards */
    .character-card img {
        height: 180px;
    }

    .character-card {
        margin-bottom: 1rem;
    }

    /* Message container - responsive height */
    .message-container {
        height: 50vh;
        min-height: 300px;
        max-height: 500px;
    }

    /* Messages */
    .message {
        max-width: 95%;
        padding: 12px;
        margin-bottom: 1rem;
    }

    .message-author {
        font-size: 0.9rem;
    }

    .message-content {
        font-size: 0.95rem;
    }

    /* Cards */
    .card {
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
    }

    /* Buttons - ensure touch-friendly sizes */
    .btn {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 1rem;
    }

    .btn-sm {
        min-height: 38px;
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .btn-lg {
        min-height: 50px;
        padding: 12px 20px;
        font-size: 1.1rem;
    }

    /* Forms - prevent zoom on iOS */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px;
        min-height: 44px;
        padding: 10px 12px;
    }

    /* Container padding */
    .container,
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Navigation */
    .navbar-brand {
        font-size: 1.1rem;
    }

    /* Player list */
    .player-list li {
        padding: 10px;
        font-size: 0.95rem;
    }

    /* Evidence items */
    .evidence-item {
        margin-bottom: 1rem;
        padding: 12px;
    }

    /* Modals */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .modal-body {
        padding: 15px;
    }

    .modal-title {
        font-size: 1.1rem;
    }

    /* Tables - make scrollable on mobile */
    .table-responsive {
        border: none;
        margin-bottom: 1rem;
    }

    /* Social login buttons */
    .btn-social {
        padding: 12px 16px;
        min-height: 48px;
    }

    /* Alerts */
    .alert {
        padding: 12px;
        font-size: 0.95rem;
    }

    /* Badges */
    .badge {
        font-size: 0.8rem;
        padding: 4px 8px;
    }

    /* Better spacing */
    .mb-3 {
        margin-bottom: 1rem !important;
    }

    .mb-4 {
        margin-bottom: 1.5rem !important;
    }

    .py-3 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .py-4 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    /* Even more compact */
    body {
        font-size: 14px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1.15rem;
    }

    /* Smaller room code */
    .room-code {
        font-size: 1rem;
        letter-spacing: 0.2em;
    }

    /* Character cards */
    .character-card img {
        height: 150px;
    }

    /* Reduce padding further */
    .card-body {
        padding: 0.75rem;
    }

    .card-header {
        padding: 0.5rem 0.75rem;
    }

    /* Smaller buttons */
    .btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    /* Stack button groups */
    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        width: 100%;
        margin-bottom: 8px;
    }
}

/* Utility Classes */
.cursor-pointer {
    cursor: pointer;
}

.text-monospace {
    font-family: 'Courier New', monospace;
}

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

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

/* Prevent Bootstrap alert auto-dismiss */
.alert-permanent {
    opacity: 1 !important;
    display: block !important;
}

.alert-permanent.fade {
    opacity: 1 !important;
}

/* Accusation Button */
.btn-accuse {
    background-color: #dc3545;
    color: white;
    font-weight: bold;
    animation: pulse 2s infinite;
}

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

.btn-accuse.highlighted {
    animation: pulse 1s infinite, shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Social Login Buttons */
.social-login-section {
    margin: 1.5rem 0;
}

.social-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
}

.social-divider::before,
.social-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #dee2e6;
}

.social-divider span {
    padding: 0 1rem;
    color: #6c757d;
    font-size: 0.875rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-social i {
    font-size: 1.25rem;
}

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

.btn-google {
    background-color: #fff;
    border: 1px solid #dadce0;
    color: #3c4043;
}

.btn-google:hover {
    background-color: #f8f9fa;
    border-color: #dadce0;
    color: #3c4043;
}

/* Fix z-index issues for Bootstrap modals and dropdowns */
/* Ensure modal backdrop doesn't cover modal content */
.modal-backdrop {
    z-index: 1040 !important;
}

.modal {
    z-index: 1050 !important;
}

.modal-dialog {
    z-index: 1060 !important;
}

/* Ensure dropdown menus appear above other content */
.dropdown-menu {
    z-index: 1070 !important;
}

/* Ensure elements within modals (like nested dropdowns) work correctly */
.modal .dropdown-menu {
    z-index: 1080 !important;
}
