/* Rollaroke.bar - Main Styles */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    overflow-x: hidden;
    position: relative;
    font-size: 0.95rem;
}

/* Animated Background */
#background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Confetti particles */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #f0f;
    opacity: 0.7;
    animation: fall linear infinite;
    z-index: -1;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

/* Main Game Container */
.game-container {
    padding: 15px;
    position: relative;
    z-index: 1;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    color: #333;
    backdrop-filter: blur(10px);
}

.card-body {
    padding: 1rem;
}

/* Compact tag clouds */
.tag {
    padding: 5px 12px;
    font-size: 0.85rem;
}

/* Compact song preferences */
#preferences-card .card-body {
    padding: 0.75rem;
}

/* Compact dice and result sections */
.song-result {
    padding: 15px;
}

#loading-state {
    padding: 30px 15px;
}

/* Logo Image */
.logo-image {
    max-width: 300px;
    height: auto;
}

.logo-image-small {
    max-width: 200px;
    height: auto;
}

/* Game Code Display */
.game-code-display {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Live Party Banner */
.live-party-banner {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 15px 20px;
    color: #fff;
    backdrop-filter: blur(10px);
}

.live-indicator {
    width: 12px;
    height: 12px;
    background: #ff4444;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.tag:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.tag.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Song Result */
.song-result {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
}

.album-art {
    width: 100%;
    max-width: 200px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

#song-title {
    color: var(--primary-color);
    font-weight: bold;
}

#song-artist {
    color: #666;
}

/* QR Code Corner */
.qr-code-corner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.qr-code-small {
    background: white;
    padding: 8px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.qr-code-small img {
    display: block;
    width: 120px !important;
    height: 120px !important;
}

/* Player Buttons */
.player-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.player-btn {
    padding: 12px 20px;
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #333;
}

.player-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.player-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.player-btn .player-btn-name {
    font-weight: bold;
}

.player-btn .player-btn-points {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-left: 8px;
}

/* Players List */
#players-list, #players-list-mobile {
    max-height: 400px;
    overflow-y: auto;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.player-item:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(5px);
}

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

.player-item.player-disabled {
    opacity: 0.5;
    background: rgba(128, 128, 128, 0.1);
}

.player-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.player-rank {
    font-size: 1.5rem;
    font-weight: bold;
    width: 40px;
    text-align: center;
}

.player-info {
    flex: 1;
    padding: 0 15px;
}

.player-name {
    font-weight: bold;
    margin-bottom: 3px;
}

.player-songs {
    font-size: 0.85rem;
    opacity: 0.8;
}

.player-points {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Player History Card */
.player-history-card {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.songs-list {
    max-height: 500px;
    overflow-y: auto;
}

.song-item {
    padding: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: background 0.2s;
}

.song-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.song-item:last-child {
    border-bottom: none;
}

.song-item-title {
    font-weight: 600;
    color: #333;
}

.song-item-artist {
    font-size: 0.9rem;
    color: #666;
}

.song-item-meta {
    font-size: 0.8rem;
    color: #999;
    margin-top: 5px;
}

/* Buttons */
.btn {
    border-radius: 25px;
    padding: 10px 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-lg {
    padding: 15px 35px;
    font-size: 1.1rem;
}

#roll-btn {
    display: inline-block;
}

/* Responsive */
@media (max-width: 991px) {
    .sidebar-column {
        margin-top: 20px;
    }

    .player-history-card {
        position: relative;
        max-height: none;
    }

    .qr-card {
        position: relative;
        top: 0;
    }
}

@media (max-width: 767px) {
    .logo-text {
        font-size: 1.5rem;
    }

    .game-header {
        flex-direction: column;
        text-align: center;
    }

    .song-result .row {
        flex-direction: column;
    }

    .song-result .col-md-3,
    .song-result .col-md-9 {
        width: 100%;
        text-align: center !important;
        margin-bottom: 15px;
    }

    .album-art {
        margin: 0 auto;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Loading State */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Nav Tabs for History */
.nav-tabs {
    border-bottom: 2px solid rgba(102, 126, 234, 0.2);
}

.nav-tabs .nav-link {
    color: #666;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
}

.nav-tabs .nav-link:hover {
    border-bottom-color: rgba(102, 126, 234, 0.5);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: none;
}

/* Live Party Card */
.live-party-card {
    background: rgba(255, 255, 255, 0.85) !important;
}

.live-party-card .card-body {
    background: rgba(102, 126, 234, 0.05);
}

.live-indicator-small {
    width: 12px;
    height: 12px;
    background: #ff0000;
    border-radius: 50%;
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

.live-album-art {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
}

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

/* Song Preferences Slide Animation */
#preferences-card {
    transition: all 0.4s ease-out;
    max-height: 1000px;
    overflow: hidden;
}

#preferences-card.collapsed {
    max-height: 0;
    margin-bottom: 0 !important;
    opacity: 0;
    transform: translateY(-20px);
}
