:root {
    --mayhem-red: #FF2D55;
    --white: #FFFFFF;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-tertiary: #F0F2F5;
    --text-primary: #1A1A1A;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --success: #00D084;
    --warning: #FFA500;
    --danger: #FF4444;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.top-bar {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.logo-section h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.social-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.social-link {
    color: var(--text-secondary);
    transition: color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-link:hover {
    color: var(--mayhem-red);
    transform: translateY(-2px);
}

.main-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    flex: 1;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.risk-dashboard,
.chat-window {
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.5s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.dashboard-header,
.chat-header {
    margin-bottom: 1.5rem;
}

.dashboard-header h2,
.chat-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.token-input-section {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

input[type="text"] {
    flex: 1;
    padding: 0.75rem 1rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--mayhem-red);
    box-shadow: 0 0 0 3px rgba(255, 45, 85, 0.1);
}

input[type="text"]::placeholder {
    color: var(--text-secondary);
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--mayhem-red) 0%, #cc2444 100%);
    border: none;
    border-radius: 8px;
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 45, 85, 0.4);
}

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

.risk-score-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.risk-dial {
    position: relative;
    width: 200px;
    height: 200px;
}

.dial-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.dial-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 12;
}

.dial-progress {
    fill: none;
    stroke: var(--mayhem-red);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 534.07;
    stroke-dashoffset: 534.07;
    transition: stroke-dashoffset 1s ease, stroke 0.5s ease;
}

.dial-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.risk-score {
    font-size: 3rem;
    font-weight: 700;
    color: var(--mayhem-red);
    line-height: 1;
    transition: all 0.5s ease;
}

.risk-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.metric-badge {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.metric-badge:hover {
    border-color: var(--mayhem-red);
    transform: translateY(-2px);
}


.metric-info {
    flex: 1;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.metric-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.metric-value.risk-low {
    color: var(--success);
}

.metric-value.risk-medium {
    color: var(--warning);
}

.metric-value.risk-high {
    color: var(--danger);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    padding-right: 0.5rem;
    min-height: 400px;
    max-height: 600px;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--mayhem-red);
    border-radius: 3px;
}

.message {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    animation: messageSlide 0.3s ease;
}

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

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-content {
    background-color: var(--mayhem-red);
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.user-message .message-avatar {
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.message-content {
    background-color: var(--bg-tertiary);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    max-width: 80%;
}

.message-text {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.chat-input-section {
    display: flex;
    gap: 0.75rem;
}

@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    
    .top-bar {
        padding: 1rem;
    }
}

@media (max-width: 640px) {
    .top-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .logo-section {
        justify-content: center;
    }
    
    .controls-section {
        justify-content: center;
    }
    
    .main-container {
        padding: 1rem;
        gap: 1rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .message-content {
        max-width: 90%;
    }
}

@media (max-width: 360px) {
    .logo-section h1 {
        font-size: 1.25rem;
    }
    
    .risk-dial {
        width: 160px;
        height: 160px;
    }
    
    .risk-score {
        font-size: 2.5rem;
    }
}
