/* =====================================================
   西洋占星術プロンプトジェネレーター - スタイル
   ===================================================== */

:root {
    --bg-primary: #0a0e27;
    --bg-secondary: #1a1040;
    --bg-tertiary: #0d1a3a;
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #c0c8e0;
    --text-muted: #7a82a0;
    --accent-gold: #FFD700;
    --accent-amber: #FFA726;
    --accent-blue: #4FC3F7;
    --accent-purple: #B388FF;
    --accent-gradient: linear-gradient(135deg, #FFD700, #FFA726);
    --btn-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
    --font-main: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Stars background */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite alternate;
}
@keyframes twinkle {
    0% { opacity: 0.2; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px 40px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    padding: 40px 0 32px;
}
.header h1 {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}
.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.subtitle .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.dot-loading { background: var(--accent-amber); animation: pulse 1.5s infinite; }
.dot-ready { background: #4caf50; }
.dot-fallback { background: var(--accent-amber); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Card */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-gold);
    margin-bottom: 24px;
}

/* Form */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.input-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

input, select {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: all 0.25s ease;
    outline: none;
}
input:focus, select:focus {
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.15);
}
input::placeholder { color: var(--text-muted); }
select option { background: #1e1e3a; color: white; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

.coord-display {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 10px 16px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    text-align: center;
}

/* Generate Button */
.btn-generate {
    width: 100%;
    padding: 18px 24px;
    background: var(--btn-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-main);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(99,102,241,0.35);
}
.btn-generate:active { transform: translateY(0); }
.btn-generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
.btn-icon { font-size: 1.3rem; }

/* Loading */
.loading-overlay {
    text-align: center;
    padding: 48px 24px;
    color: var(--accent-gold);
}
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255,215,0,0.2);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-detail {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Output */
.output-section { display: none; }
.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.output-header .section-title { margin-bottom: 0; }
.output-actions {
    display: flex;
    gap: 8px;
}
.btn-action {
    padding: 8px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-action:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-1px);
}

.output-text {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    padding: 24px;
    font-family: 'Noto Sans JP', monospace;
    font-size: 0.88rem;
    line-height: 1.85;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.output-text::-webkit-scrollbar { width: 6px; }
.output-text::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

/* Matrix Table */
.matrix-section {
    margin-top: 4px;
}
.matrix-section .section-title {
    margin-bottom: 16px;
}
.matrix-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 16px;
}
.matrix-table th,
.matrix-table td {
    padding: 14px 12px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 0.95rem;
}
.matrix-table thead th {
    background: linear-gradient(135deg, rgba(255,215,0,0.18), rgba(255,167,38,0.12));
    color: var(--accent-gold);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}
.matrix-table thead th:first-child {
    background: rgba(255,255,255,0.03);
}
.matrix-table tbody th {
    background: rgba(255,215,0,0.08);
    color: var(--accent-gold);
    font-weight: 600;
    min-width: 50px;
}
.matrix-table tbody td {
    background: rgba(255,255,255,0.03);
    color: var(--text-primary);
    font-size: 1.15rem;
    letter-spacing: 2px;
    min-width: 80px;
    transition: background 0.2s ease;
}
.matrix-table tbody td:hover {
    background: rgba(255,255,255,0.08);
}
.matrix-table tbody td .cell-empty {
    color: var(--text-muted);
    font-size: 0.8rem;
}
.matrix-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}
.summary-group {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}
.summary-group h4 {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}
.summary-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.summary-item {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.05);
    padding: 4px 10px;
    border-radius: 20px;
}
.summary-item .count {
    color: var(--accent-gold);
    font-weight: 600;
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.8;
}
.footer a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}
.footer a:hover {
    color: var(--accent-gold);
    text-decoration: underline;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(76, 175, 80, 0.95);
    color: white;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    z-index: 1000;
    transition: transform 0.3s ease;
    backdrop-filter: blur(10px);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* Responsive */
@media (max-width: 600px) {
    .container { padding: 12px 8px 32px; }
    .card { padding: 20px 16px; border-radius: var(--radius-md); }
    .form-grid { grid-template-columns: 1fr; gap: 14px; }
    .output-header { flex-direction: column; align-items: flex-start; }
    .btn-generate { font-size: 1rem; padding: 16px 20px; }
}
