/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-bg: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--dark-bg);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1;
}

.logo svg {
    filter: drop-shadow(0 4px 8px rgba(37, 99, 235, 0.4));
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--success-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% { 
        opacity: 0.8;
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
}

.time {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Main Content */
.main-content {
    display: grid;
    gap: 2rem;
}

/* Section Styles */
.live-section,
.playback-section,
.info-section,
.export-section {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.live-section:hover,
.playback-section:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.live-badge {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
    animation: blink 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

@keyframes blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.98); }
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1.5rem;
}

.camera-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.camera-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(139, 92, 246, 0.1));
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.camera-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(37, 99, 235, 0.25);
    border-color: var(--primary-color);
}

.camera-card:hover::before {
    opacity: 1;
}

.camera-preview {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    overflow: hidden;
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, 
        rgba(37, 99, 235, 0.9) 0%, 
        rgba(139, 92, 246, 0.9) 100%);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.preview-overlay::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: ripple 3s ease-out infinite;
}

@keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 400px;
        height: 400px;
        opacity: 0;
    }
}

.preview-overlay:hover {
    background: linear-gradient(135deg, 
        rgba(37, 99, 235, 1) 0%, 
        rgba(139, 92, 246, 1) 100%);
}

.play-button {
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.play-button:hover {
    transform: scale(1.15);
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.4));
}

.play-button:active {
    transform: scale(1.05);
}

.camera-info {
    text-align: center;
    color: white;
    position: relative;
    z-index: 1;
}

.camera-info h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
}

.camera-info p {
    font-size: 0.875rem;
    opacity: 0.95;
    font-weight: 500;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.camera-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-controls {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.75rem;
    z-index: 10;
}

.control-btn {
    padding: 0.625rem 1.25rem;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.control-btn:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.control-btn:active {
    transform: translateY(0);
}

.camera-footer {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    border-top: 1px solid var(--border-color);
}

.camera-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.camera-status {
    padding: 0.375rem 0.875rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.camera-status.online {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.camera-status.offline {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Playback Card */
.playback-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, 
        rgba(37, 99, 235, 0.1) 0%, 
        rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 16px;
    transition: all 0.4s ease;
}

.playback-card:hover {
    background: linear-gradient(135deg, 
        rgba(37, 99, 235, 0.15) 0%, 
        rgba(139, 92, 246, 0.15) 100%);
    border-color: var(--primary-color);
}

.playback-icon {
    flex-shrink: 0;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.playback-info {
    flex: 1;
}

.playback-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.playback-info p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

.feature-list {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.feature-list li {
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-list li::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
}

.playback-button {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
    position: relative;
    overflow: hidden;
}

.playback-button::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 ease;
}

.playback-button:hover::before {
    left: 100%;
}

.playback-button:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 20px 40px -10px rgba(37, 99, 235, 0.6);
}

.playback-button:active {
    transform: translateY(-2px) scale(1.02);
}

/* Export Section */
.export-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.export-card {
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.export-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.form-group input[type="datetime-local"],
.form-group input[type="password"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.9375rem;
    width: 100%;
}

.form-group input[type="datetime-local"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.6);
}

.export-status {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success-color);
    border-radius: 8px;
}

.export-status p {
    font-size: 0.9375rem;
    color: var(--success-color);
    margin-bottom: 0.75rem;
}

.progress-bar {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    height: 8px;
    overflow: hidden;
}

.progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--success-color), #059669);
    border-radius: 5px;
    transition: width 0.5s ease-in-out;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    margin-top: 1rem;
    display: inline-block; /* For the <a> tag */
    text-decoration: none;
    text-align: center;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.6);
}

/* Info Section */
.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, 
        rgba(37, 99, 235, 0.05) 0%, 
        rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.info-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 4px 8px rgba(37, 99, 235, 0.3));
}

.info-content h4 {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.info-content p {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Footer */
.footer {
    margin-top: 3rem;
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(37, 99, 235, 0.2);
    border-top-color: var(--primary-color);
    border-right-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    box-shadow: 0 0 30px rgba(37, 99, 235, 0.3);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    color: var(--text-primary);
    margin-top: 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 2rem;
}

.modal-body p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9375rem;
}

.modal-footer {
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.6);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .playback-card {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1.25rem 1.5rem;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .header-info {
        flex-direction: column;
        gap: 0.75rem;
    }

    .section-header h2 {
        font-size: 1.25rem;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .playback-card {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
        justify-items: center;
    }

    .playback-info h3 {
        font-size: 1.25rem;
    }

    .feature-list {
        justify-content: center;
    }

    .playback-button {
        width: 100%;
        justify-content: center;
    }

    .info-section {
        grid-template-columns: 1fr;
    }

    .control-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }

    .header {
        padding: 1rem;
        border-radius: 12px;
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    .live-section,
    .playback-section,
    .info-section {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .section-header h2 {
        font-size: 1.125rem;
    }

    .camera-info h3 {
        font-size: 1.5rem;
    }

    .playback-icon svg {
        width: 80px;
        height: 80px;
    }
}

/* WebSocket Test Button and Panel */
.ws-broadcast-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    margin-right: 0.5rem;
}

.ws-broadcast-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.5);
}

.ws-broadcast-btn:active {
    transform: translateY(0);
}

/* Broadcast notification */
.broadcast-notification {
    position: fixed;
    top: 100px;
    right: 2rem;
    width: 350px;
    background: var(--card-bg);
    border: 2px solid var(--success-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-xl);
    z-index: 2000;
    animation: slideInRight 0.4s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(400px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.broadcast-notification.hide {
    animation: slideOutRight 0.4s ease forwards;
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

.notification-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.notification-icon {
    font-size: 1.5rem;
}

.notification-content {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.notification-time {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.75rem;
    opacity: 0.7;
}

.ws-test-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    margin-right: 1rem;
}

.ws-test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.ws-panel {
    position: fixed;
    top: 50%;
    right: 2rem;
    transform: translateY(-50%);
    width: 400px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.ws-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 12px 12px 0 0;
}

.ws-panel-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
}

.ws-panel-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.ws-panel-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.ws-panel-body {
    padding: 1.25rem;
}

.ws-status {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.ws-status-label {
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.ws-status-value {
    font-weight: 600;
    color: var(--warning-color);
}

.ws-status-value.connected {
    color: var(--success-color);
}

.ws-status-value.disconnected {
    color: var(--danger-color);
}

.ws-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ws-btn {
    flex: 1;
    padding: 0.625rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ws-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ws-btn-connect {
    background: var(--success-color);
    color: white;
}

.ws-btn-connect:hover:not(:disabled) {
    background: #059669;
}

.ws-btn-disconnect {
    background: var(--danger-color);
    color: white;
}

.ws-btn-disconnect:hover:not(:disabled) {
    background: #dc2626;
}

.ws-btn-test {
    background: var(--primary-color);
    color: white;
}

.ws-btn-test:hover:not(:disabled) {
    background: var(--primary-dark);
}

.ws-messages {
    margin-top: 1rem;
}

.ws-messages-header {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.ws-messages-content {
    max-height: 300px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
}

.ws-messages-content::-webkit-scrollbar {
    width: 6px;
}

.ws-messages-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.ws-messages-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.ws-messages-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.ws-message {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.4;
}

.ws-message:last-child {
    margin-bottom: 0;
}

.ws-message-sent {
    background: rgba(37, 99, 235, 0.2);
    border-left: 3px solid var(--primary-color);
}

.ws-message-received {
    background: rgba(16, 185, 129, 0.2);
    border-left: 3px solid var(--success-color);
}

.ws-message-error {
    background: rgba(239, 68, 68, 0.2);
    border-left: 3px solid var(--danger-color);
}

.ws-message-time {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-right: 0.5rem;
}

.ws-message-content {
    color: var(--text-primary);
}