/* CLANKER.WORKS - Agent Pages Specific Styles */

/* ===== Agent Page Layout ===== */
.agent-page {
    overflow: hidden;
    height: 100vh;
    background: #000000;
}

/* ===== Background Effects ===== */
.bg-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.cyber-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.scan-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 255, 0.03) 2px,
        rgba(0, 255, 255, 0.03) 4px
    );
    animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(10px); }
}

.noise-texture {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.02;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIj48ZmlsdGVyIGlkPSJhIj48ZmVUdXJidWxlbmNlIGJhc2VGcmVxdWVuY3k9Ii44IiBudW1PY3RhdmVzPSI0IiAvPjwvZmlsdGVyPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbHRlcj0idXJsKCNhKSIgb3BhY2l0eT0iMSIgLz48L3N2Zz4=');
}

/* ===== Header Styles ===== */
.agent-header {
    position: relative;
    z-index: 100;
    background: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 100%);
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    padding: 1rem 0;
}

.header-container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #00FFFF;
    text-decoration: none;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0, 255, 255, 0.3);
    background: rgba(0, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.back-link:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: #00FFFF;
    transform: translateX(-5px);
}

.agent-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #00FFFF;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
}

.title-icon {
    font-size: 1.8rem;
    animation: pulse 2s ease-in-out infinite;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 20px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #00FF00;
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(0, 255, 0, 0); }
}

.status-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: #00FF00;
}

.session-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    color: #F8F8FF;
    opacity: 0.8;
}

/* ===== Main Layout ===== */
.agent-main {
    position: relative;
    z-index: 10;
    height: calc(100vh - 80px);
    display: flex;
    gap: 1rem;
    padding: 1rem;
    max-width: 1920px;
    margin: 0 auto;
}

/* ===== Chat Panel ===== */
.chat-panel {
    flex: 0 0 30%;
    background: rgba(5, 5, 5, 0.8);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.1);
}

.chat-header {
    padding: 1rem;
    background: rgba(0, 255, 255, 0.05);
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: #00FFFF;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-controls {
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #00FFFF;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.control-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00FFFF;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    scroll-behavior: smooth;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 255, 255, 0.05);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.3);
    border-radius: 3px;
}

.message {
    margin-bottom: 1rem;
    animation: messageSlide 0.3s ease-out;
}

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

.message-user {
    text-align: right;
}

.message-agent {
    text-align: left;
}

.message-content {
    display: inline-block;
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.message-user .message-content {
    background: rgba(255, 0, 128, 0.1);
    border: 1px solid rgba(255, 0, 128, 0.3);
    color: #F8F8FF;
}

.message-agent .message-content {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #F8F8FF;
}

.message-timestamp {
    font-size: 0.75rem;
    color: #696969;
    margin-top: 0.25rem;
    font-family: 'JetBrains Mono', monospace;
}

.chat-input-container {
    padding: 1rem;
    background: rgba(0, 255, 255, 0.05);
    border-top: 1px solid rgba(0, 255, 255, 0.3);
}

.chat-input-wrapper {
    display: flex;
    gap: 0.5rem;
    position: relative;
}

.chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #F8F8FF;
    padding: 0.75rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: #00FFFF;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.chat-input::placeholder {
    color: #696969;
}

.send-btn {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #00FFFF;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.send-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00FFFF;
    transform: translateY(-2px);
}

.voice-btn {
    background: rgba(255, 0, 128, 0.1);
    border: 1px solid rgba(255, 0, 128, 0.3);
    color: #FF0080;
}

.voice-btn:hover {
    background: rgba(255, 0, 128, 0.2);
    border-color: #FF0080;
}

/* ===== Stream Panel ===== */
.stream-panel {
    flex: 0 0 50%;
    background: rgba(5, 5, 5, 0.8);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.crt-frame {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.crt-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 2px;
    animation: crtScan 8s linear infinite;
}

@keyframes crtScan {
    0% { transform: translateY(0); }
    100% { transform: translateY(10px); }
}

.crt-frame::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse at center,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.4) 100%
    );
}

.stream-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #050505;
}

.stream-placeholder {
    text-align: center;
    color: #696969;
    font-family: 'JetBrains Mono', monospace;
}

.stream-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.stream-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    z-index: 11;
}

.stream-btn {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #00FFFF;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stream-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00FFFF;
}

.stream-btn.active {
    background: rgba(0, 255, 0, 0.2);
    border-color: #00FF00;
    color: #00FF00;
}

.stream-metrics {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 255, 255, 0.3);
    padding: 0.5rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #00FFFF;
    z-index: 11;
}

.metric {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.metric:last-child {
    margin-bottom: 0;
}

.metric-label {
    color: #696969;
}

.metric-value {
    color: #00FFFF;
}

/* ===== Action Log Panel ===== */
.log-panel {
    flex: 0 0 20%;
    background: rgba(5, 5, 5, 0.8);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.log-header {
    padding: 1rem;
    background: rgba(0, 255, 255, 0.05);
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.log-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #00FFFF;
}

.log-controls {
    display: flex;
    gap: 0.25rem;
}

.log-btn {
    background: transparent;
    border: none;
    color: #00FFFF;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.log-btn:hover {
    color: #F8F8FF;
}

.log-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
}

.log-content::-webkit-scrollbar {
    width: 4px;
}

.log-content::-webkit-scrollbar-track {
    background: rgba(0, 255, 255, 0.05);
}

.log-content::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.3);
    border-radius: 2px;
}

.log-entry {
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    border-left: 2px solid transparent;
    transition: all 0.3s ease;
    animation: logSlide 0.3s ease-out;
}

@keyframes logSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.log-entry:hover {
    background: rgba(0, 255, 255, 0.05);
}

.log-entry.click {
    border-left-color: #00FFFF;
}

.log-entry.type {
    border-left-color: #FF0080;
}

.log-entry.navigate {
    border-left-color: #00FF00;
}

.log-entry.scroll {
    border-left-color: #FFFF00;
}

.log-timestamp {
    color: #696969;
    margin-right: 0.5rem;
}

.log-action {
    color: #00FFFF;
    font-weight: 600;
    margin-right: 0.5rem;
}

.log-details {
    color: #F8F8FF;
    opacity: 0.8;
}

/* ===== Responsive Design ===== */
@media (max-width: 1440px) {
    .agent-main {
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .chat-panel {
        flex: 0 0 28%;
    }
    
    .stream-panel {
        flex: 0 0 52%;
    }
}

@media (max-width: 1024px) {
    .agent-main {
        flex-direction: column;
    }
    
    .chat-panel,
    .stream-panel,
    .log-panel {
        flex: 1;
        width: 100%;
    }
    
    .log-panel {
        max-height: 200px;
    }
}

@media (max-width: 768px) {
    .agent-header {
        padding: 0.75rem 0;
    }
    
    .header-container {
        padding: 0 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .agent-title {
        font-size: 1.125rem;
    }
    
    .chat-panel {
        min-height: 300px;
    }
    
    .stream-panel {
        min-height: 400px;
    }
    
    .log-panel {
        display: none;
    }
}

/* ===== Special Effects ===== */
.ripple-effect {
    position: absolute;
    border: 2px solid #00FFFF;
    border-radius: 50%;
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple {
    from {
        width: 0;
        height: 0;
        opacity: 1;
    }
    to {
        width: 50px;
        height: 50px;
        opacity: 0;
    }
}

.typing-indicator {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
}

.typing-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #00FFFF;
    border-radius: 50%;
    margin: 0 2px;
    animation: typingPulse 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingPulse {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* ===== Context Menu ===== */
.context-menu {
    position: absolute;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 4px;
    padding: 0.5rem 0;
    min-width: 200px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 255, 255, 0.2);
    display: none;
}

.context-menu.active {
    display: block;
}

.context-menu-item {
    padding: 0.5rem 1rem;
    color: #F8F8FF;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.context-menu-item:hover {
    background: rgba(0, 255, 255, 0.1);
    color: #00FFFF;
}

.context-menu-divider {
    height: 1px;
    background: rgba(0, 255, 255, 0.3);
    margin: 0.5rem 0;
}

/* ===== Loading States ===== */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 255, 255, 0.3);
    border-top-color: #00FFFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== Ghost Mode ===== */
body.ghost-mode .chat-panel,
body.ghost-mode .log-panel {
    opacity: 0.1;
    transition: opacity 0.3s ease;
}

body.ghost-mode .chat-panel:hover,
body.ghost-mode .log-panel:hover {
    opacity: 1;
}

body.ghost-mode .agent-header {
    transform: translateY(-90%);
    transition: transform 0.3s ease;
}

body.ghost-mode .agent-header:hover {
    transform: translateY(0);
}