/* Random Connect - Custom Styles */

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #334155;
    line-height: 1.6;
}

/* SaaS Brand Styling */
.brand-logo {
    display: flex;
    align-items: center;
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom Bootstrap Colors */
.bg-primary-soft {
    background-color: rgba(102, 126, 234, 0.1) !important;
}

.text-primary {
    color: #667eea !important;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 14px 0 rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(102, 126, 234, 0.4);
}

.btn-outline-primary {
    border-color: #667eea;
    color: #667eea;
}

.btn-outline-primary:hover {
    background: #667eea;
    border-color: #667eea;
    transform: translateY(-1px);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="a" cx="50%" cy="50%"><stop offset="0%" stop-color="%23667eea" stop-opacity="0.1"/><stop offset="100%" stop-color="%23667eea" stop-opacity="0"/></radialGradient></defs><circle cx="200" cy="200" r="150" fill="url(%23a)"/><circle cx="800" cy="300" r="200" fill="url(%23a)"/><circle cx="400" cy="700" r="180" fill="url(%23a)"/></svg>') no-repeat center center;
    background-size: cover;
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    color: #1e293b;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #64748b;
    max-width: 500px;
}

.hero-badge .badge {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 500;
}

.hero-stats {
    margin-top: 3rem;
}

.stat-item {
    padding: 1rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

/* Video Preview */
.video-preview-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.video-preview {
    background: #1e293b;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.video-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.video-placeholder {
    text-align: center;
    padding: 3rem 1rem;
    position: relative;
    z-index: 2;
}

.video-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    position: relative;
    z-index: 2;
}

/* Features Section */
.features-section {
    background: white;
    position: relative;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
}

.feature-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 1.5rem;
}

.feature-card h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

.feature-card p {
    color: #64748b;
    margin: 0;
}

/* Landing Page Styles */
.hero-section h1 {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.chat-card {
    border: none;
    border-radius: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.chat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1) !important;
}

.chat-icon {
    padding: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.05);
    display: inline-block;
    margin-bottom: 20px;
}

.btn-lg {
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

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

/* Chat Interface Styles */
#chat-interface {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.status-bar {
    flex-shrink: 0;
    border-bottom: 1px solid #dee2e6;
}

.video-container {
    flex: 1;
    background: #000;
    position: relative;
    overflow: hidden;
}

.remote-video-container,
.local-video-container {
    position: relative;
    height: 100vh;
    background: #1a1a1a;
}

.local-video-container {
    border-left: 2px solid #333;
}

#remote-video,
#local-video {
    object-fit: cover;
    background: #000;
}

.video-label {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.audio-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 20px;
    border-radius: 50%;
    font-size: 2rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.controls-bar {
    flex-shrink: 0;
    border-top: 1px solid #333;
}

.btn-group .btn {
    border-radius: 50px !important;
    margin: 0 5px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-group .btn:hover {
    transform: scale(1.1);
}

.btn-group .btn.active {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

/* Connection Status Badges */
.badge {
    font-size: 0.9rem;
    padding: 8px 15px;
    border-radius: 20px;
}

.bg-searching {
    background-color: #ffc107 !important;
}

.bg-matched {
    background-color: #17a2b8 !important;
}

.bg-connected {
    background-color: #28a745 !important;
}

.bg-disconnected {
    background-color: #dc3545 !important;
}

/* Loading Modal */
.modal-content {
    border: none;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .chat-card .card-body {
        padding: 2rem !important;
    }
    
    .video-container .row {
        flex-direction: column;
    }
    
    .local-video-container {
        height: 30vh;
        border-left: none;
        border-top: 2px solid #333;
    }
    
    .remote-video-container {
        height: 70vh;
    }
    
    .btn-group .btn {
        width: 45px;
        height: 45px;
        margin: 0 3px;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .chat-card .card-body {
        padding: 1.5rem !important;
    }
    
    .btn-lg {
        padding: 12px 30px !important;
        font-size: 1rem;
    }
    
    .controls-bar .container-fluid {
        padding: 0 10px;
    }
}

/* Chat Sidebar */
.chat-sidebar {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #1a1a1a;
    border-left: 2px solid #333;
}

.local-video-container {
    position: relative;
    height: 200px;
    background: #000;
    border-bottom: 1px solid #333;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #2c2c2c;
}

.chat-header {
    padding: 12px 16px;
    background: #343a40;
    border-bottom: 1px solid #495057;
    display: flex;
    align-items: center;
    color: #fff;
    font-weight: 600;
}

.chat-header button {
    border: none;
    background: none;
    color: #adb5bd;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.chat-header button:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #2c2c2c;
    max-height: calc(100vh - 350px);
}

.chat-welcome {
    text-align: center;
    color: #6c757d;
    padding: 20px;
}

.chat-welcome i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.message {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    animation: messageSlideIn 0.3s ease-out;
}

.message.own {
    align-items: flex-end;
}

.message.other {
    align-items: flex-start;
}

.message-bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
}

.message.own .message-bubble {
    background: #007bff;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.other .message-bubble {
    background: #495057;
    color: #fff;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 4px;
    padding: 0 4px;
}

.message.emoji .message-bubble {
    background: transparent;
    font-size: 2rem;
    padding: 4px;
}

.message.system {
    align-items: center;
}

.message.system .message-bubble {
    background: rgba(255,193,7,0.2);
    color: #ffc107;
    font-size: 0.85rem;
    font-style: italic;
    border-radius: 12px;
}

.chat-input-container {
    padding: 12px 16px;
    background: #343a40;
    border-top: 1px solid #495057;
}

.chat-input-container .input-group {
    margin-bottom: 4px;
}

.chat-input-container .form-control {
    background: #495057;
    border: 1px solid #6c757d;
    color: #fff;
    border-radius: 20px 0 0 20px;
}

.chat-input-container .form-control:focus {
    background: #495057;
    border-color: #007bff;
    color: #fff;
    box-shadow: none;
}

.chat-input-container .btn {
    border-radius: 0;
}

.chat-input-container .btn:last-child {
    border-radius: 0 20px 20px 0;
}

.char-counter {
    font-size: 0.75rem;
    color: #6c757d;
    text-align: right;
}

.char-counter.warning {
    color: #ffc107;
}

.char-counter.danger {
    color: #dc3545;
}

/* Emoji Picker */
.emoji-picker {
    position: absolute;
    bottom: 60px;
    right: 16px;
    background: #343a40;
    border: 1px solid #495057;
    border-radius: 8px;
    padding: 12px;
    display: none;
    z-index: 1000;
    max-width: 280px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.emoji-picker.show {
    display: block;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.emoji-item {
    padding: 8px;
    text-align: center;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1.2rem;
    transition: background 0.2s ease;
}

.emoji-item:hover {
    background: rgba(255,255,255,0.1);
}

/* Voice-only mode */
.voice-only #local-video,
.voice-only #remote-video {
    display: none;
}

.voice-only .remote-video-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-only .remote-video-container::before {
    content: '\f007';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 8rem;
    color: rgba(255,255,255,0.3);
}

.voice-only .local-video-container {
    height: 120px;
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-only .local-video-container::before {
    content: '\f007';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 3rem;
    color: rgba(255,255,255,0.5);
}

/* Chat animations */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: #6c757d;
    font-style: italic;
    font-size: 0.85rem;
}

.typing-dots {
    display: inline-flex;
    margin-left: 8px;
}

.typing-dots span {
    height: 4px;
    width: 4px;
    background: #6c757d;
    border-radius: 50%;
    display: inline-block;
    margin: 0 1px;
    animation: typingDots 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingDots {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animation for connection states */
.connecting {
    animation: connecting-pulse 2s infinite;
}

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

/* Bottom Navigation Bar - Mobile Only */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    border-top: 1px solid #e2e8f0;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    display: none; /* Hidden by default */
}

/* Show bottom nav only on mobile devices */
@media (max-width: 768px) {
    .bottom-nav {
        display: block;
    }
}

.bottom-nav-btn {
    background: none;
    border: none;
    color: #64748b;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    transition: all 0.3s ease;
    border-radius: 12px;
    margin: 4px;
    font-size: 0.75rem;
}

.bottom-nav-btn:hover,
.bottom-nav-btn:focus {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    transform: translateY(-2px);
}

.bottom-nav-btn i {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.bottom-nav-btn span {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Adjust main content to account for bottom nav - Mobile only */
@media (max-width: 768px) {
    body {
        padding-bottom: 80px;
    }
    
    #chat-interface {
        padding-bottom: 80px;
    }
}

/* Modal Enhancements */
.modal-content {
    border: none;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* Statistics Cards */
.stat-card {
    padding: 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

/* Rating Stars */
.rating-stars {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.rating-stars i {
    font-size: 1.5rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.3s ease;
}

.rating-stars i:hover,
.rating-stars i.active {
    color: #ffc107;
}

/* Enhanced Controls Bar */
.controls-bar {
    position: relative;
    z-index: 1040;
}

.btn-group .btn {
    border-radius: 25px !important;
    margin: 0 3px;
    min-width: 60px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-group .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-group .btn:hover::before {
    left: 100%;
}

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

/* Fullscreen styles */
.fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: #000 !important;
}

.fullscreen-mode .video-container {
    height: 100vh !important;
}

.fullscreen-mode .bottom-nav {
    display: none;
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    .bottom-nav-btn i {
        font-size: 1.1rem;
    }
    
    .bottom-nav-btn span {
        font-size: 0.7rem;
    }
    
    .bottom-nav {
        padding: 8px 0;
    }
    
    /* Mobile padding already handled above */
    
    .controls-bar .btn-group .btn {
        min-width: 50px;
        height: 45px;
        margin: 0 2px;
    }
    
    .controls-bar .btn-group .btn span {
        display: none !important;
    }
    
    .modal-dialog {
        margin: 10px;
    }
    
    .stat-card {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    /* Mobile chat layout */
    .video-container .row {
        flex-direction: column;
    }
    
    .chat-sidebar {
        height: 50vh;
        border-left: none;
        border-top: 2px solid #333;
    }
    
    .local-video-container {
        height: 150px;
    }
    
    .chat-messages {
        max-height: calc(50vh - 200px);
    }
    
    .remote-video-container {
        height: 50vh;
    }
}

@media (max-width: 576px) {
    .bottom-nav-btn {
        padding: 10px 4px;
    }
    
    .bottom-nav-btn i {
        font-size: 1rem;
        margin-bottom: 2px;
    }
    
    .bottom-nav-btn span {
        font-size: 0.65rem;
    }
    
    /* Mobile padding already handled above */
    
    .controls-bar .container-fluid {
        padding: 0 5px;
    }
    
    .btn-group .btn {
        min-width: 45px;
        height: 40px;
        font-size: 0.9rem;
    }
}

/* Landscape mobile adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .bottom-nav {
        display: none;
    }
    
    body {
        padding-bottom: 0 !important;
    }
    
    #chat-interface {
        padding-bottom: 0 !important;
    }
    
    .controls-bar {
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0,0,0,0.8);
        border-radius: 25px;
        padding: 5px;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background: rgba(33, 37, 41, 0.98);
        color: #fff;
    }
    
    .modal-header {
        border-bottom-color: rgba(255,255,255,0.1);
    }
    
    .stat-card {
        background: linear-gradient(135deg, #495057 0%, #343a40 100%);
        color: #fff;
    }
    
    .form-control,
    .form-select {
        background-color: #495057;
        border-color: #6c757d;
        color: #fff;
    }
    
    .form-control:focus,
    .form-select:focus {
        background-color: #495057;
        border-color: #007bff;
        color: #fff;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .bottom-nav-btn,
    .btn-group .btn,
    .stat-card,
    .chat-card {
        transition: none;
    }
    
    .connecting {
        animation: none;
    }
    
    .btn-group .btn::before {
        display: none;
    }
}

/* Room Modal Styling */
.room-code-display input {
    background: #f1f5f9;
    border: 2px dashed #cbd5e1;
    font-family: 'Monaco', 'Menlo', monospace;
}

.room-details {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
}

.room-details .col-4 {
    border-right: 1px solid #e2e8f0;
}

.room-details .col-4:last-child {
    border-right: none;
}

/* Form Enhancements */
.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Alert Styling */
.alert-info {
    background-color: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.2);
    color: #4c51bf;
}

/* Responsive Hero Section */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .video-preview {
        padding: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .feature-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .bottom-nav {
        background: #000 !important;
        border-top: 2px solid #fff;
    }
    
    .bottom-nav-btn {
        border: 1px solid #fff;
    }
    
    .modal-content {
        border: 2px solid #000;
    }
}
