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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

body.mobile {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 16px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.subtitle {
    opacity: 0.9;
    font-size: 1rem;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.card h2 {
    margin-bottom: 16px;
    color: #333;
}

.card h3 {
    margin-bottom: 12px;
    color: #555;
    font-size: 1rem;
}

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

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

.input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

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

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.link-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.link-display {
    display: block;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
    word-break: break-all;
    color: #667eea;
    text-decoration: none;
    margin: 12px 0;
}

.link-display:hover {
    text-decoration: underline;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
}

.status.connected .status-dot {
    background: #4caf50;
    box-shadow: 0 0 5px #4caf50;
}

.status.disconnected .status-dot {
    background: #f44336;
}

.status-text {
    font-size: 14px;
    font-weight: 500;
}

#qr-section {
    text-align: center;
}

#qr-code {
    max-width: 250px;
    height: auto;
    margin: 20px auto;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 10px;
}

.session-id {
    color: #666;
    font-size: 12px;
    margin: 10px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

.iframe-wrapper {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.iframe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.iframe-header span {
    font-size: 12px;
    color: #666;
    word-break: break-all;
    flex: 1;
    margin-right: 12px;
}

#link-frame {
    width: 100%;
    height: 500px;
    border: none;
}

.message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
}

.message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
}

.info-card ul {
    list-style: none;
    padding-left: 0;
}

.info-card li {
    padding: 8px 0;
    color: #666;
    font-size: 14px;
}

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

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

@media (max-width: 600px) {
    body {
        padding: 12px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 16px;
    }
    
    .link-actions {
        flex-direction: column;
    }
    
    #link-frame {
        height: 400px;
    }
}