/* PQCrypta WebTransport Streaming Test Page Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

body {
    font-family:
        'Segoe UI',
        system-ui,
        -apple-system,
        sans-serif;
    background: #000814;
    color: #ffffff;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 20px;
}

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

::-webkit-scrollbar-track {
    background: #001428;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 6px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #7788ff, #8855cc);
}

/* Firefox scrollbar styling */
* {
    scrollbar-width: thin;
    scrollbar-color: #667eea #001428;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(0, 20, 40, 0.7);
    border-radius: 16px;
    box-shadow:
        0 20px 60px rgba(102, 126, 234, 0.2),
        0 0 100px rgba(102, 126, 234, 0.1);
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.header {
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.3) 0%,
        rgba(0, 200, 255, 0.25) 25%,
        rgba(118, 75, 162, 0.3) 50%,
        rgba(255, 100, 150, 0.25) 75%,
        rgba(102, 126, 234, 0.3) 100%
    );
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    color: white;
    padding: 20px 30px;
    text-align: center;
    border-bottom: 2px solid rgba(102, 200, 234, 0.4);
    position: relative;
    overflow: hidden;
}

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

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        transparent 0%,
        rgba(0, 255, 200, 0.1) 25%,
        rgba(102, 126, 234, 0.15) 50%,
        rgba(255, 100, 200, 0.1) 75%,
        transparent 100%
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%,
    100% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
}

/* Logo Section for 3D Animated Logo - MATCHES HOMEPAGE EXACTLY */
.logo-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    width: 100%;
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 400px;
    flex: 1;
}

.logo-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 50%;
    opacity: 0.75;
    box-shadow:
        0 0 30px rgba(0, 255, 255, 0.6),
        0 0 60px rgba(0, 255, 255, 0.4);
    transition: all 0.3s ease;
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(2deg);
    }
}

.quantum-3d-logo-canvas {
    width: 100%;
    height: 150px;
    margin: 0;
    position: relative;
    display: block;
    overflow: visible;
}

.quantum-3d-logo-canvas canvas {
    display: block;
    margin: 0 auto;
}

.quantum-logo-hidden {
    display: none;
}

.logo-section-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

.logo-image-small {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    box-shadow:
        0 0 30px rgba(102, 126, 234, 0.6),
        0 0 60px rgba(102, 126, 234, 0.4);
    border: 3px solid rgba(102, 126, 234, 0.5);
    object-fit: cover;
}

.header h1 {
    font-size: 2.5rem;
    margin: 0;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    margin: 10px 0 0 0;
}

.content {
    padding: 30px;
}

.test-info-section {
    background: linear-gradient(
        135deg,
        rgba(15, 30, 60, 0.5) 0%,
        rgba(30, 15, 60, 0.5) 50%,
        rgba(15, 30, 60, 0.5) 100%
    );
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid rgba(150, 100, 234, 0.4);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}

.test-info-section h2 {
    background: linear-gradient(90deg, #88aaff 0%, #aa88ff 50%, #ff88aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    font-size: 1.5rem;
    text-shadow: 0 0 20px rgba(150, 126, 234, 0.6);
    filter: drop-shadow(0 0 15px rgba(150, 126, 234, 0.5));
}

.test-info-section h3 {
    background: linear-gradient(90deg, #88aaff 0%, #aa88ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    margin-top: 20px;
    font-size: 1.2rem;
    filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.4));
}

.test-description {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #a0b0d0;
    margin-bottom: 15px;
}

.instructions {
    background: linear-gradient(135deg, rgba(0, 10, 30, 0.5) 0%, rgba(10, 0, 30, 0.5) 100%);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid;
    border-image: linear-gradient(180deg, #667eea 0%, #aa66ff 50%, #ff66aa 100%) 1;
    box-shadow: 0 4px 16px rgba(150, 100, 234, 0.2);
}

.instruction-list {
    margin-left: 20px;
    color: #c0d0e0;
    line-height: 1.8;
}

.instruction-list li {
    margin-bottom: 10px;
    padding-left: 5px;
    transition: color 0.3s ease;
}

.instruction-list li:hover {
    color: #d0e0ff;
}

.instruction-list strong {
    background: linear-gradient(90deg, #88aaff 0%, #aa88ff 50%, #ff88dd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    filter: drop-shadow(0 0 10px rgba(150, 126, 234, 0.4));
}

.status-panel {
    background: rgba(15, 30, 60, 0.5);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

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

.status-label {
    font-weight: 600;
    color: #a0b0d0;
}

.status-value {
    font-family: 'Courier New', monospace;
    color: #88aaff;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.status-connected {
    color: #00ff88;
    text-shadow: 0 0 15px rgba(0, 255, 136, 0.6);
}

.status-disconnected {
    color: #ff4466;
    text-shadow: 0 0 15px rgba(255, 68, 102, 0.6);
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid rgba(102, 126, 234, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: rgba(15, 30, 60, 0.5);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%);
    border-color: #667eea;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow:
        0 8px 25px rgba(102, 126, 234, 0.5),
        0 0 30px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, rgba(102, 126, 234, 1) 0%, rgba(118, 75, 162, 1) 100%);
}

.btn-success {
    background: rgba(0, 200, 100, 0.3);
    border-color: #00c864;
}

.btn-success:hover:not(:disabled) {
    background: rgba(0, 200, 100, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 200, 100, 0.4);
}

.btn-danger {
    background: rgba(220, 53, 69, 0.3);
    border-color: #dc3545;
}

.btn-danger:hover:not(:disabled) {
    background: rgba(220, 53, 69, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}

.btn-info {
    background: rgba(23, 162, 184, 0.3);
    border-color: #17a2b8;
}

.btn-info:hover:not(:disabled) {
    background: rgba(23, 162, 184, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(23, 162, 184, 0.4);
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
    border-color: rgba(102, 126, 234, 0.2);
}

.test-section {
    background: rgba(15, 30, 60, 0.5);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.test-section h2 {
    color: #88aaff;
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
}

.data-display-section h2 {
    color: #88aaff;
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 700;
    text-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
}

.key-item h3 {
    color: #88aaff;
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.5);
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.4);
}

.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: #a0b0d0;
    margin-bottom: 8px;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: rgba(0, 10, 30, 0.5);
    color: #ffffff;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'Courier New', monospace;
}

.character-counter {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(0, 10, 30, 0.5);
    border-radius: 6px;
    font-size: 0.9rem;
    color: #a0b0d0;
    border: 1px solid rgba(102, 126, 234, 0.2);
    text-align: right;
}

.char-count {
    font-weight: 700;
    color: #88aaff;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.4);
}

.char-limit {
    color: #a0b0d0;
}

.char-remaining {
    font-size: 0.85rem;
    color: #00ff88;
    font-weight: 600;
    margin-left: 8px;
}

.char-remaining.warning {
    color: #ffaa00;
}

.char-remaining.danger {
    color: #ff4466;
}

.input-group select {
    cursor: pointer;
}

.input-group select option {
    background: #001428;
    color: #ffffff;
}

.results {
    background: rgba(0, 10, 30, 0.8);
    color: #00ff88;
    padding: 20px;
    border-radius: 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 20px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.results pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(15, 30, 60, 0.5);
    padding: 18px;
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-left: 4px solid #667eea;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.stat-label {
    font-size: 0.85rem;
    color: #a0b0d0;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #88aaff;
    text-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
}

.data-display-section {
    background: rgba(15, 30, 60, 0.5);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.data-display-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.key-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

@media (max-width: 900px) {
    .key-display {
        grid-template-columns: 1fr;
    }
}

.key-item {
    background: rgba(0, 10, 30, 0.5);
    padding: 18px;
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.key-textarea {
    width: 100%;
    min-height: 180px;
    padding: 15px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    background: rgba(0, 5, 20, 0.8);
    color: #00ff88;
    resize: vertical;
    word-break: break-all;
    line-height: 1.6;
    transition: all 0.3s ease;
}

.key-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

.key-info {
    margin-top: 12px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.2);
}

.key-size-info {
    font-size: 0.95rem;
    color: white;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.encrypted-display {
    margin-top: 10px;
    background: rgba(0, 10, 30, 0.5);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.encrypted-textarea {
    width: 100%;
    min-height: 220px;
    padding: 15px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    background: rgba(0, 5, 20, 0.8);
    color: #00ff88;
    resize: vertical;
    word-break: break-all;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.encrypted-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

.encrypted-info {
    margin-top: 12px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.2);
}

.data-size-info {
    font-size: 0.95rem;
    color: white;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.compression-info {
    font-size: 0.95rem;
    color: #ffd700;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.ml-algorithm-info {
    font-size: 0.95rem;
    color: #90ee90;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.compression-control {
    margin-bottom: 20px;
}

.compression-label {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-weight: 600;
    color: #a0b0d0;
    cursor: pointer;
    user-select: none;
}

.compression-checkbox {
    width: 20px !important;
    height: 20px;
    min-width: 20px;
    cursor: pointer;
    accent-color: #667eea;
    flex-shrink: 0;
    margin: 0;
}

.compression-checkbox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.compression-text {
    line-height: 20px;
}

.compression-note {
    display: block;
    font-size: 0.85rem;
    margin-top: 8px;
    margin-left: 30px;
    font-weight: normal;
    line-height: 1.5;
}

.compression-note.compression-disabled {
    color: #ff4466;
    font-style: italic;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(255, 68, 102, 0.3);
}

.compression-note.compression-enabled {
    color: #00ff88;
    font-style: normal;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.decrypted-display {
    margin-top: 10px;
    background: rgba(0, 10, 30, 0.5);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.decrypted-textarea {
    width: 100%;
    min-height: 180px;
    padding: 15px;
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: rgba(0, 5, 20, 0.8);
    color: #00ff88;
    resize: vertical;
    word-break: break-word;
    line-height: 1.6;
    transition: all 0.3s ease;
}

.decrypted-textarea:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.decrypted-info {
    margin-top: 12px;
    padding: 12px 18px;
    background: linear-gradient(135deg, rgba(0, 200, 100, 0.3) 0%, rgba(0, 255, 136, 0.3) 100%);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 16px rgba(0, 255, 136, 0.2);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.decryption-status-info {
    font-size: 0.95rem;
    color: #ffd700;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    display: flex;
    opacity: 1;
}

.loading-content {
    text-align: center;
    background: rgba(0, 20, 40, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px 60px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.4);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.loading-spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border: 6px solid rgba(102, 126, 234, 0.2);
    border-top: 6px solid #667eea;
    border-right: 6px solid #764ba2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.4);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

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

.loading-subtext {
    font-size: 1rem;
    color: #a0b0d0;
    font-weight: 500;
}

/* Responsive Logo Styling */
@media (max-width: 768px) {
    .logo-section {
        flex-direction: column;
    }

    .logo-text {
        min-width: 300px;
        align-items: center;
    }

    .quantum-3d-logo-canvas {
        height: 130px;
    }

    .quantum-3d-logo-canvas canvas {
        height: 130px !important;
    }

    .logo-section-inline {
        flex-direction: column;
        gap: 15px;
    }

    .logo-image-small {
        width: 60px;
        height: 60px;
    }

    .header h1 {
        font-size: 1.8rem;
    }
}
