/**
 * カスタマーサポート・営業AIシステム用CSS
 * モダンでスタイリッシュなデザイン
 */

/* カラーパレット - より洗練されたグラデーション */
:root {
    --primary-blue: #2563eb;
    --light-blue: #3b82f6;
    --dark-blue: #1e40af;
    --accent-blue: #60a5fa;
    --purple-accent: #8b5cf6;
    --cyan-accent: #06b6d4;
    --bg-light: #f8fafc;
    --bg-medium: #f1f5f9;
    --bg-dark: #e2e8f0;
    --text-dark: #0f172a;
    --text-medium: #334155;
    --text-light: #64748b;
    --white: #ffffff;
    --shadow-sm: rgba(15, 23, 42, 0.05);
    --shadow-md: rgba(37, 99, 235, 0.15);
    --shadow-lg: rgba(37, 99, 235, 0.25);
    --shadow-xl: rgba(15, 23, 42, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.18);
}

/* ヒーローセクション - より洗練されたグラデーション */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #2563eb 50%, #3b82f6 75%, #60a5fa 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    padding: 120px 0;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

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

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.3) 0%, transparent 50%),
        url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.08)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 1;
    animation: float 20s ease-in-out infinite;
}

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

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.9) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 25px;
    opacity: 0.95;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-description {
    font-size: 1.15rem;
    line-height: 1.9;
    opacity: 0.92;
    max-width: 700px;
    margin: 0 auto;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

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

/* 機能説明セクション - ガラスモーフィズム効果 */
.features-section {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--bg-light) 0%, var(--white) 50%, var(--bg-medium) 100%);
    position: relative;
}

.features-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.features-section h2 {
    text-align: center;
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 60px;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-dark) 0%, var(--primary-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.features-section h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--purple-accent), var(--cyan-accent));
    border-radius: 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.feature-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 45px 35px;
    border: 1px solid var(--glass-border);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 8px 32px var(--shadow-md),
        0 2px 8px var(--shadow-sm),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--purple-accent), var(--cyan-accent));
    transform: scaleX(0);
    transition: transform 0.5s ease;
}

.feature-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 
        0 20px 60px var(--shadow-lg),
        0 8px 24px var(--shadow-md),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: rgba(37, 99, 235, 0.3);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--purple-accent) 50%, var(--cyan-accent) 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    font-size: 2.2rem;
    color: var(--white);
    box-shadow: 
        0 8px 24px rgba(37, 99, 235, 0.3),
        0 4px 12px rgba(139, 92, 246, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.feature-card:hover .feature-icon {
    transform: rotate(5deg) scale(1.1);
    box-shadow: 
        0 12px 32px rgba(37, 99, 235, 0.4),
        0 6px 16px rgba(139, 92, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.feature-card h3 {
    color: var(--text-dark);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 18px;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

.feature-card:hover h3 {
    color: var(--primary-blue);
}

.feature-card p {
    color: var(--text-medium);
    font-size: 1.05rem;
    line-height: 1.8;
    transition: color 0.3s ease;
}

.feature-card:hover p {
    color: var(--text-dark);
}

/* チャットセクション - ガラスモーフィズム */
.chat-section {
    padding: 80px 0;
    background: linear-gradient(180deg, var(--bg-medium) 0%, var(--bg-light) 50%, var(--white) 100%);
    position: relative;
}

.chat-container {
    max-width: 950px;
    margin: 0 auto;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 32px;
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 20px 60px var(--shadow-xl),
        0 8px 24px var(--shadow-md),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    overflow: hidden;
    transition: all 0.4s ease;
}

.chat-container:hover {
    box-shadow: 
        0 24px 72px var(--shadow-lg),
        0 12px 32px var(--shadow-md),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.chat-header {
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-avatar {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    overflow: hidden;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.chat-avatar:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 
        0 6px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.chat-header-text h3 {
    color: var(--white);
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 5px 0;
}

.chat-status {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-status i {
    font-size: 0.7rem;
    color: #4ade80;
    animation: pulse 2s infinite;
}

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

.chat-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.chat-messages {
    height: 520px;
    overflow-y: auto;
    padding: 30px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.5) 0%, rgba(241, 245, 249, 0.3) 100%);
    min-height: 300px;
    position: relative;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.5);
    border-radius: 10px;
    margin: 8px 0;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--purple-accent) 100%);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: all 0.3s ease;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--purple-accent) 0%, var(--cyan-accent) 100%);
    background-clip: padding-box;
}

.message {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

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

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

.message-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    color: var(--white);
}

.user-message .message-avatar {
    background: linear-gradient(135deg, var(--accent-blue), var(--light-blue));
    color: var(--white);
}

.message-content {
    flex: 1;
    background: var(--white);
    padding: 16px 22px;
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 
        0 4px 12px var(--shadow-sm),
        0 2px 4px rgba(0, 0, 0, 0.02);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.message-content:hover {
    box-shadow: 
        0 6px 16px var(--shadow-md),
        0 2px 6px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--purple-accent) 100%);
    color: var(--white);
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: 
        0 4px 16px rgba(37, 99, 235, 0.25),
        0 2px 6px rgba(139, 92, 246, 0.15);
}

.message-content p {
    color: var(--text-dark);
    margin: 0;
    line-height: 1.7;
}

.user-message .message-content p {
    color: var(--white);
}

.message-time {
    color: var(--text-light);
    font-size: 0.75rem;
    align-self: flex-end;
    margin-top: auto;
    padding: 0 5px;
}

.typing-indicator .message-content {
    padding: 15px 20px;
    background: var(--white);
}

.typing-dots {
    display: flex;
    gap: 6px;
}

.typing-dots span {
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, var(--primary-blue), var(--purple-accent));
    border-radius: 50%;
    animation: typing 1.4s infinite;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

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

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

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

.chat-input-container {
    padding: 28px;
    background: linear-gradient(180deg, var(--white) 0%, rgba(248, 250, 252, 0.8) 100%);
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.quick-questions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.quick-question-btn {
    background: var(--bg-light);
    border: 2px solid var(--accent-blue);
    color: var(--primary-blue);
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    outline: none;
}

.quick-question-btn:hover:not(.disabled):not(:disabled) {
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
    border-color: var(--primary-blue);
}

.quick-question-btn:focus:not(.disabled):not(:disabled) {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.quick-question-btn.disabled,
.quick-question-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.quick-question-btn i {
    font-size: 0.9rem;
}

.chat-form {
    display: flex;
    gap: 10px;
}

.chat-input-wrapper {
    flex: 1;
    display: flex;
    background: var(--bg-light);
    border-radius: 30px;
    border: 2px solid var(--bg-dark);
    padding: 5px;
    transition: all 0.3s ease;
}

.chat-input-wrapper:focus-within {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-dark);
    padding: 12px 20px;
    font-size: 1rem;
    outline: none;
}

.chat-input::placeholder {
    color: var(--text-light);
}

.chat-send-btn {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--purple-accent) 100%);
    border: none;
    color: var(--white);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 
        0 6px 20px rgba(37, 99, 235, 0.3),
        0 2px 8px rgba(139, 92, 246, 0.2);
    position: relative;
    overflow: hidden;
}

.chat-send-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.12) rotate(5deg);
    box-shadow: 
        0 8px 28px rgba(37, 99, 235, 0.4),
        0 4px 12px rgba(139, 92, 246, 0.3);
}

.chat-send-btn:hover:not(:disabled)::before {
    width: 300px;
    height: 300px;
}

.chat-send-btn:active:not(:disabled) {
    transform: scale(1.05) rotate(0deg);
}

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

/* ログイン状態バー - ガラスモーフィズム */
.user-bar {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--purple-accent) 50%, var(--cyan-accent) 100%);
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
    padding: 14px 0;
    text-align: right;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.user-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}

.user-bar span {
    color: var(--white);
    font-weight: 500;
}

.user-bar a {
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 5px;
}

.user-bar a:hover {
    background: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .hero {
        padding: 80px 0;
    }
    
    .hero h1 {
        font-size: 2.25rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .features-section {
        padding: 60px 0;
    }
    
    .features-section h2 {
        font-size: 2rem;
        margin-bottom: 40px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .feature-card {
        padding: 35px 25px;
    }
    
    .chat-section {
        padding: 40px 0;
    }
    
    .chat-container {
        border-radius: 24px;
        margin: 0 16px;
    }
    
    .chat-messages {
        height: 400px;
        padding: 20px;
    }
    
    .chat-header {
        padding: 20px 24px;
        flex-wrap: wrap;
    }
    
    .chat-header-info {
        flex: 1;
        min-width: 200px;
    }
    
    .chat-avatar {
        width: 48px;
        height: 48px;
        font-size: 1.4rem;
    }
    
    .quick-questions {
        flex-direction: column;
        gap: 8px;
    }
    
    .quick-question-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }
    
    .chat-input-container {
        padding: 20px;
    }
    
    .chat-input-wrapper {
        border-radius: 28px;
    }
    
    .chat-send-btn {
        width: 48px;
        height: 48px;
    }
    
    .network-notification {
        top: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
        padding: 14px 20px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .features-section h2 {
        font-size: 1.75rem;
    }
    
    .feature-card {
        padding: 30px 20px;
    }
    
    .feature-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
}

/* コンテナ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ネットワーク通知 - ガラスモーフィズム */
.network-notification {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 4px 16px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    animation: slideInBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 380px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.network-notification.offline {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.9) 100%);
    color: #ffffff;
}

.network-notification.online {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9) 0%, rgba(5, 150, 105, 0.9) 100%);
    color: #ffffff;
}

.network-notification i {
    font-size: 20px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes slideInBounce {
    0% {
        transform: translateX(120%) scale(0.8);
        opacity: 0;
    }
    60% {
        transform: translateX(-10px) scale(1.05);
        opacity: 0.9;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}
