/* VALORANT 専用スタイル */

/* Map Options */
.map-selection {
    margin-bottom: 2rem;
}

.map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.map-option {
    padding: 1rem !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 0px !important; /* Sharp corners */
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    color: var(--text-muted) !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    min-height: 50px !important;
    position: relative;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.map-option:hover {
    border-color: var(--color-accent) !important;
    background: rgba(255, 70, 85, 0.1) !important;
    color: var(--text-primary) !important;
    transform: translateY(-2px) !important;
}

.map-option.selected {
    border: 1px solid var(--color-accent) !important;
    background: var(--color-accent) !important;
    color: white !important;
    box-shadow: var(--shadow-neon) !important;
    transform: none !important;
}

/* Light theme support removed as per global style decision */

/* Light theme map options */
[data-theme="light"] .map-option {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #0a1f2e !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .map-option:hover {
    border-color: var(--color-primary) !important;
    background: rgba(59, 130, 246, 0.1) !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3) !important;
}

[data-theme="light"] .map-option.selected {
    border-color: var(--color-primary) !important;
    background: rgba(59, 130, 246, 0.15) !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4) !important;
}

/* Agent Selection */
.agent-section {
    margin-bottom: 2rem;
}

.agent-filter {
    margin-bottom: 1rem;
    position: relative;
}

.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.agent-option {
    padding: 0.75rem 1rem !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 0px !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-size: 0.9rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--text-muted) !important;
    box-shadow: none !important;
    min-height: 45px !important;
    backdrop-filter: none !important;
    position: relative;
}

/* Corner accent for agents */
.agent-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 6px 0 0;
    border-color: var(--text-muted) transparent transparent transparent;
    transition: all 0.2s;
}

.agent-option:hover {
    border-color: var(--color-accent) !important;
    background: rgba(255, 70, 85, 0.1) !important;
    color: var(--text-primary) !important;
    transform: translateY(-2px) !important;
}

.agent-option:hover::before {
    border-color: var(--color-accent) transparent transparent transparent;
}

.agent-option.selected {
    border-color: var(--color-accent) !important;
    background: var(--color-accent) !important;
    color: white !important;
    box-shadow: var(--shadow-neon) !important;
    transform: none !important;
}

/* Light theme agent options */
[data-theme="light"] .agent-option {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.9)) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #0a1f2e !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .agent-option:hover {
    border-color: var(--color-primary) !important;
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.1), rgba(248, 250, 252, 0.95)) !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3) !important;
}

[data-theme="light"] .agent-option.selected {
    border-color: var(--color-primary) !important;
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.15), rgba(248, 250, 252, 0.95)) !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4) !important;
}

/* Score and KDA Inputs */
.score-section,
.kda-section {
    margin-bottom: 2rem;
}

.score-inputs,
.kda-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.score-input-group,
.kda-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.score-input-group label,
.kda-input-group label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: center;
}

.score-input-group input,
.kda-input-group input {
    width: 80px;
    padding: 0.75rem;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    border: 2px solid var(--glass-border);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.score-input-group input:focus,
.kda-input-group input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.score-separator,
.kda-separator {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0 0.5rem;
}

/* Stats Section */
.stats-section {
    margin-bottom: 2rem;
}

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

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

.stat-input-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.stat-input-group input {
    padding: 0.75rem;
    border: 2px solid var(--glass-border);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.stat-input-group input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

/* VALORANT Match Cards */
.valorant-match-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--text-muted); /* Default border */
    border-radius: 0px;
    padding: 1.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.valorant-match-card:hover {
    transform: translateX(4px); /* Slide right instead of up */
    background: rgba(236, 232, 225, 0.08);
}

.valorant-match-card.win {
    border-left: 4px solid var(--color-success);
}

.valorant-match-card.loss {
    border-left: 4px solid var(--color-danger);
    background: linear-gradient(90deg, rgba(255, 70, 85, 0.05) 0%, transparent 100%);
}

.valorant-match-card.draw {
    border-left: 4px solid var(--color-warning);
}

.match-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.match-map {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.map-icon {
    font-size: 1.2rem;
}

.map-name {
    color: var(--text-primary);
}

.match-score {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
}

.match-score.win {
    background: rgba(0, 200, 150, 0.2);
    color: #00c896;
}

.match-score.loss {
    background: rgba(255, 70, 85, 0.2);
    color: #ff4655;
}

.match-score.draw {
    background: rgba(255, 184, 0, 0.2);
    color: #ffb800;
}

.match-card-body {
    margin-bottom: 1rem;
}

.agent-info {
    margin-bottom: 1rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.agent-label {
    color: var(--text-secondary);
}

.agent-name {
    font-weight: 600;
    color: var(--color-accent);
    font-size: 1.1rem;
}

.match-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 0.25rem 0;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

.match-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.match-tag {
    padding: 0.25rem 0.75rem;
    background: rgba(233, 69, 96, 0.15);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.match-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.match-date {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.delete-match-btn {
    padding: 0.25rem 0.75rem;
    background: transparent;
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.delete-match-btn:hover {
    background: var(--color-danger);
    color: white;
}

/* No matches message */
.no-matches-message {
    text-align: center;
    padding: 3rem 1rem;
}

.message-text {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.message-sub {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Light theme adjustments for VALORANT cards */
[data-theme="light"] .valorant-match-card {
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.95), 
        rgba(248, 250, 252, 0.9)
    );
    border: 2px solid rgba(59, 130, 246, 0.2);
}

[data-theme="light"] .valorant-match-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
}

[data-theme="light"] .valorant-match-card.win {
    border-left: 4px solid #059669;
}

[data-theme="light"] .valorant-match-card.loss {
    border-left: 4px solid #dc2626;
}

[data-theme="light"] .agent-name {
    color: #3b82f6;
}

[data-theme="light"] .match-score.win {
    background: rgba(5, 150, 105, 0.15);
    color: #059669;
}

[data-theme="light"] .match-score.loss {
    background: rgba(220, 38, 38, 0.15);
    color: #dc2626;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .map-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .agent-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .score-inputs,
    .kda-inputs {
        flex-direction: column;
    }
}

/* ========================================
   Selection Mode - Selected Card Styling
   ======================================== */

/* カードが選択されたときの強調表示 */
.gallery-grid.selection-mode .valorant-match-card:has(input:checked) {
    border: 3px solid var(--color-accent) !important;
    background: linear-gradient(145deg,
        rgba(233, 69, 96, 0.15),
        rgba(22, 33, 62, 0.95)
    ) !important;
    box-shadow:
        0 0 0 4px rgba(233, 69, 96, 0.4),
        0 12px 32px rgba(233, 69, 96, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.03) translateY(-2px) !important;
    animation: selectedPulse 2s ease-in-out infinite;
    position: relative;
}

/* 選択カードの左ボーダーのオーバーライド */
.gallery-grid.selection-mode .valorant-match-card.win:has(input:checked),
.gallery-grid.selection-mode .valorant-match-card.loss:has(input:checked),
.gallery-grid.selection-mode .valorant-match-card.draw:has(input:checked) {
    border-left: 6px solid var(--color-accent) !important;
}

/* 選択カードのグロー効果 */
.gallery-grid.selection-mode .valorant-match-card:has(input:checked)::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 16px;
    background: linear-gradient(
        90deg,
        rgba(233, 69, 96, 0.6),
        rgba(255, 70, 130, 0.5),
        rgba(233, 69, 96, 0.6),
        rgba(255, 70, 130, 0.5),
        rgba(233, 69, 96, 0.6)
    );
    background-size: 200% 200%;
    animation: borderGlow 2s linear infinite;
    z-index: -1;
    pointer-events: none;
    filter: blur(4px);
    opacity: 0.9;
}

/* ライトモード - 選択カード */
[data-theme="light"] .gallery-grid.selection-mode .valorant-match-card:has(input:checked) {
    border: 4px solid var(--color-primary) !important;
    background: linear-gradient(145deg,
        rgba(59, 130, 246, 0.2),
        rgba(255, 255, 255, 0.98),
        rgba(59, 130, 246, 0.12)
    ) !important;
    box-shadow:
        0 0 0 6px rgba(59, 130, 246, 0.4),
        0 16px 40px rgba(59, 130, 246, 0.6),
        0 0 60px rgba(59, 130, 246, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.9),
        inset 0 0 40px rgba(59, 130, 246, 0.15) !important;
    filter: brightness(1.1) saturate(1.3);
}

[data-theme="light"] .gallery-grid.selection-mode .valorant-match-card.win:has(input:checked),
[data-theme="light"] .gallery-grid.selection-mode .valorant-match-card.loss:has(input:checked),
[data-theme="light"] .gallery-grid.selection-mode .valorant-match-card.draw:has(input:checked) {
    border-left: 6px solid var(--color-primary) !important;
}

[data-theme="light"] .gallery-grid.selection-mode .valorant-match-card:has(input:checked)::before {
    background: linear-gradient(
        90deg,
        rgba(59, 130, 246, 0.5),
        rgba(96, 165, 250, 0.4),
        rgba(59, 130, 246, 0.5),
        rgba(96, 165, 250, 0.4),
        rgba(59, 130, 246, 0.5)
    );
    opacity: 0.85;
}

/* 選択カードのパルスアニメーション */
@keyframes selectedPulse {
    0%, 100% {
        box-shadow:
            0 0 0 6px rgba(233, 69, 96, 0.5),
            0 16px 40px rgba(233, 69, 96, 0.7),
            0 0 60px rgba(233, 69, 96, 0.4),
            inset 0 2px 4px rgba(255, 255, 255, 0.25),
            inset 0 0 40px rgba(233, 69, 96, 0.2);
    }
    50% {
        box-shadow:
            0 0 0 8px rgba(233, 69, 96, 0.7),
            0 20px 50px rgba(233, 69, 96, 0.8),
            0 0 80px rgba(233, 69, 96, 0.5),
            inset 0 2px 6px rgba(255, 255, 255, 0.35),
            inset 0 0 50px rgba(233, 69, 96, 0.3);
    }
}

/* ボーダーのグローアニメーション */
@keyframes borderGlow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

/* 選択カードのホバー時 */
.gallery-grid.selection-mode .valorant-match-card:has(input:checked):hover {
    transform: scale(1.07) translateY(-5px) !important;
    box-shadow:
        0 0 0 8px rgba(233, 69, 96, 0.6),
        0 20px 50px rgba(233, 69, 96, 0.8),
        0 0 100px rgba(233, 69, 96, 0.5),
        inset 0 2px 6px rgba(255, 255, 255, 0.3),
        inset 0 0 50px rgba(233, 69, 96, 0.25) !important;
    filter: brightness(1.3) saturate(1.4);
}

[data-theme="light"] .gallery-grid.selection-mode .valorant-match-card:has(input:checked):hover {
    box-shadow:
        0 0 0 8px rgba(59, 130, 246, 0.5),
        0 20px 50px rgba(59, 130, 246, 0.7),
        0 0 100px rgba(59, 130, 246, 0.4),
        inset 0 2px 6px rgba(255, 255, 255, 1),
        inset 0 0 50px rgba(59, 130, 246, 0.2) !important;
    filter: brightness(1.2) saturate(1.4);
}

/* ===== Dashboard Gallery Styles ===== */

/* Gallery Card */
.gallery-card {
    margin-bottom: 1.5rem;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.gallery-header h3 {
    margin: 0;
}

/* Gallery Filters */
.gallery-filters {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--glass-border);
}

.filter-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn-small {
    padding: 0.35rem 0.75rem !important;
    font-size: 0.8rem !important;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* Match Card in Gallery */
.gallery-match-card {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gallery-match-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: var(--color-accent);
}

.gallery-match-card.win {
    border-left: 4px solid #10b981;
}

.gallery-match-card.loss {
    border-left: 4px solid #ef4444;
}

.gallery-match-card.draw {
    border-left: 4px solid #f59e0b;
}

/* Card Header */
.gallery-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.gallery-map-info {
    flex: 1;
}

.gallery-map-name {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.gallery-score {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-accent);
}

.gallery-result-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.gallery-result-badge.win {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.gallery-result-badge.loss {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.gallery-result-badge.draw {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* Card Body */
.gallery-card-body {
    margin-bottom: 0.75rem;
}

.gallery-agent {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.gallery-kda {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.gallery-kda-ratio {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

/* Stats Grid */
.gallery-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(0,0,0,0.3), rgba(0,0,0,0.1));
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.gallery-stat {
    text-align: center;
    padding: 0.5rem 0.25rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    transition: all 0.2s ease;
}

.gallery-stat:hover {
    background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    transform: translateY(-2px);
}

.gallery-stat-label {
    font-size: 0.6rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.gallery-stat-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

/* Good stats - green glow */
.gallery-stat-value.good {
    color: #10b981;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Average stats - yellow */
.gallery-stat-value.average {
    color: #f59e0b;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

/* Bad stats - red */
.gallery-stat-value.bad {
    color: #ef4444;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* Card Footer */
.gallery-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--glass-border);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* No Matches Message */
.gallery-grid .no-matches-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
}

.no-matches-message .message-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.no-matches-message .message-sub {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-row {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: auto;
    }
}

/* ===== Floating AI Chat Styles ===== */

/* Floating Button */
.floating-chat-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    max-width: 64px;
    max-height: 64px;
    border-radius: 0; /* Square/Angular */
    background: var(--bg-secondary);
    border: 1px solid var(--color-accent);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow: hidden;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.floating-chat-btn .chat-btn-icon {
    width: 32px; /* Smaller icon fit inside */
    height: 32px;
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
    border-radius: 0;
    display: block;
}

.floating-chat-btn:hover {
    transform: scale(1.1);
    background: var(--color-accent);
    box-shadow: 0 6px 30px rgba(255, 70, 85, 0.4);
}

.floating-chat-btn:active {
    transform: scale(0.95);
}

/* Chat Popup */
.floating-chat-popup {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 360px;
    max-width: calc(100vw - 48px);
    height: 480px;
    max-height: calc(100vh - 120px);
    background: var(--bg-primary);
    border: 1px solid var(--glass-border);
    border-radius: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
}

.floating-chat-popup.hidden {
    display: none;
}

/* Chat Header */
.chat-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--glass-border);
}

.chat-popup-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-popup-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.chat-popup-close:hover {
    color: var(--text-primary);
}

/* Chat Body */
.chat-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.chat-message.assistant {
    align-self: flex-start;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-message.user {
    align-self: flex-end;
    background: var(--color-accent);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message .message-content {
    word-wrap: break-word;
}

/* Chat Footer */
.chat-popup-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--glass-border);
    background: var(--bg-secondary);
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input-wrapper input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.chat-input-wrapper input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.chat-send-btn {
    padding: 10px 20px;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    min-width: 60px;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: #ff6b8a;
}

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

/* Loading indicator for chat */
.chat-message.loading .message-content {
    display: flex;
    gap: 4px;
}

.chat-message.loading .dot {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: chatDot 1.4s infinite ease-in-out both;
}

.chat-message.loading .dot:nth-child(1) { animation-delay: -0.32s; }
.chat-message.loading .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes chatDot {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .floating-chat-btn {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
        min-width: 56px;
        min-height: 56px;
        max-width: 56px;
        max-height: 56px;
    }

    .floating-chat-btn .chat-btn-icon {
        width: 56px;
        height: 56px;
        max-width: 56px;
        max-height: 56px;
    }

    .floating-chat-popup {
        bottom: 82px;
        right: 8px;
        left: 8px;
        width: auto;
        height: calc(100vh - 100px);
    }
}
