/* 
   Phasor Diagram Animation Styles (Updated)
*/

:root {
    --bg-color: #f8fafb;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --brand-green: #01894d;
    --brand-orange: #f39800;
    --brand-red: #ff0000;
    --brand-dashed-green: #22c55e;
    --primary-hover: #00703e;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
    --radius: 8px;
}

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

body {
    font-family: 'Noto Sans JP', 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
}

/* Header */
.main-header {
    background-color: var(--brand-green);
    border-bottom: 3px solid var(--brand-orange);
    padding: 15px 0;
    color: #ffffff;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.main-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-icon {
    width: 28px;
    height: 28px;
}

.brand-logo {
    font-weight: 700;
    font-size: 1.25rem;
}

.btn-home {
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.container {
    max-width: 1100px;
    margin: 90px auto 40px;
    padding: 0 20px;
}

/* Info Section */
.info-section {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow: hidden;
}

.info-header {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background-color: #fdfdfd;
}

.info-header h2 {
    font-size: 1.05rem;
    color: var(--brand-green);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-icon {
    width: 20px;
    height: 20px;
}

.info-content {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.info-section.collapsed .info-content {
    display: none;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.card h2 {
    font-size: 1.15rem;
    color: var(--brand-green);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--brand-orange);
}

.section-number {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 26px;
    height: 26px;
    background-color: var(--brand-green);
    color: #fff;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
}

/* Visualization */
.main-viz-container {
    width: 100%;
    overflow-x: auto;
    background-color: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    margin-bottom: 20px;
    position: relative; /* For absolute overlays */
}

.viz-overlay {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 5px 10px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 5;
}

.time-overlay {
    top: 10px;
    right: 10px;
}

.formula-overlay {
    top: 50px;
    right: 10px;
}

canvas {
    display: block;
    margin: 0 auto;
    max-width: 1000px;
    width: 100%;
}

.playback-controls {
    display: flex;
    justify-content: center;
}

.calculate-btn {
    width: 200px;
    padding: 12px;
    background-color: var(--brand-green);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.calculate-btn:hover {
    background-color: var(--primary-hover);
}

.btn-outline {
    width: 200px;
    padding: 12px;
    background-color: transparent;
    color: var(--brand-green);
    border: 2px solid var(--brand-green);
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline:hover {
    background-color: var(--brand-green);
    color: #fff;
}

.controls-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.controls-title {
    font-size: 1rem;
    color: var(--brand-green);
    margin: 0;
}

.help-btn {
    width: 22px;
    height: 22px;
    background-color: var(--brand-orange);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.help-btn:hover {
    background-color: #d88700;
    transform: scale(1.1);
}

.help-content-box {
    background-color: #fff9f0;
    border: 1px solid #ffe8c8;
    border-radius: 6px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: max-height 0.3s ease, margin 0.3s ease, opacity 0.3s ease;
}

.help-content-box.collapsed {
    max-height: 0;
    margin-bottom: 0;
    opacity: 0;
    border: none;
}

.help-inner {
    padding: 15px;
}

.help-formula {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ffe8c8;
}

.parameter-list {
    list-style: none;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.parameter-list li {
    margin-bottom: 5px;
}

/* Controls (moved below) */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px 40px;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group label {
    min-width: 60px;
    margin-bottom: 0;
    font-weight: 600;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

input[type="range"] {
    flex: 1;
    accent-color: var(--brand-green);
}

input[type="number"] {
    width: 80px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.mode-toggle-container {
    display: flex;
    gap: 20px;
    align-items: center;
}

.radio-label {
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.radio-label input[type="radio"] {
    accent-color: var(--brand-green);
    width: 18px;
    height: 18px;
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}
