:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #94a3b8;
    --text-color: #f8fafc;
    --bg-color: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-red: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0) 70%);
    border-radius: 50%;
    filter: blur(80px);
}

.blob-1 {
    top: -10%;
    right: -10%;
    animation: move 20s infinite alternate;
}

.blob-2 {
    bottom: -10%;
    left: -10%;
    animation: move 25s infinite alternate-reverse;
}

@keyframes move {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(100px, 100px);
    }
}

header {
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.lang-selector {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 12px;
    display: flex;
    border: 1px solid var(--glass-border);
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--secondary-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.lang-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status-indicator {
    font-size: 0.875rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
}

.status-indicator::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 8px #22c55e;
}

.status-indicator.recording::before {
    background-color: var(--accent-red);
    box-shadow: 0 0 12px var(--accent-red);
    animation: blink 1s infinite;
}

@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

.container {
    flex: 1;
    display: flex;
    gap: 2rem;
    padding: 0 2rem 2rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.glass-panel {
    flex: 1;
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.icon-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-button:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}




textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.6;
    resize: none;
    outline: none;
}

.output-content {
    flex: 1;
    font-size: 1.1rem;
    line-height: 1.8;
    overflow-y: auto;
}


.icon-button-circle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-button-circle:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

.placeholder-text {
    color: var(--secondary-color);
    font-style: italic;
    opacity: 0.6;
}

.mic-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.mic-button:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.mic-button.recording {
    background: var(--accent-red);
}

.mic-icon {
    width: 24px;
    height: 24px;
    fill: white;
    z-index: 2;
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent-red);
    opacity: 0;
    z-index: 1;
}

.mic-button.recording .pulse-ring {
    animation: pulse 2s infinite;
}

.voice-status-badge {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    pointer-events: none;
}

.status-indicator {
    width: 6px;
    height: 6px;
    background: #888;
    border-radius: 50%;
}

.status-indicator.recording {
    background: #ff5252;
    box-shadow: 0 0 5px #ff5252;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.secondary-button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.primary-button {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.primary-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.secondary-button.speaking {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(108, 92, 231, 0.4);
}

.summary-list {
    list-style: none;
}

.summary-item {
    background: rgba(99, 102, 241, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0 12px 12px 0;
    animation: slideIn 0.4s ease-out;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.summary-point {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    animation: slideIn 0.3s ease-out;
}

.summary-point:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(4px);
}

.point-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.summary-point p {
    flex: 1;
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color);
    word-break: break-all;
}

.summary-header {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.item-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.mode-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@keyframes slideIn {
    from {
        transform: translateX(20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.sample-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.sample-title {
    font-size: 0.8rem;
    color: var(--secondary-color);
    font-weight: 600;
}

.chip-button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--secondary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.chip-button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.share-container {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
    animation: fadeIn 0.5s ease;
}

.share-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    border: none;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.twitter-color {
    background-color: #000000;
    /* X (Twitter) black */
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.twitter-color:hover {
    background-color: #333;
    transform: scale(1.05);
}

.guide-icon {
    margin-right: 0.5rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

footer {
    padding: 2rem;
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.85rem;
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text-color);
    text-decoration: underline;
}

.ad-wrapper {
    margin-top: 1rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ad-label {
    font-size: 0.7rem;
    color: var(--secondary-color);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

.ad-box {
    width: 100%;
    max-width: 728px;
    height: 90px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    font-size: 0.8rem;
    border-radius: 8px;
}

.guide-section {
    margin-top: 3rem;
    margin-bottom: 3rem;
    padding: 3rem !important;
    flex: none !important;
}

.guide-section h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-color);
}

.guide-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.guide-body h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.guide-body p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--secondary-color);
}

@media (max-width: 900px) {
    .container {
        flex-direction: column;
    }

    .glass-panel {
        min-height: 300px;
        flex: none;
    }

    .ad-box {
        height: 250px;
        max-width: 300px;
    }
}