/**
 * Saju Comparison Styles — 墨金 Dark Luxury
 */

/* Floating Comparison Button */
.btn-comparison.floating-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-deep));
    color: var(--color-bg-primary);
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
    z-index: 100;
    transition: all 0.3s ease;
}

.btn-comparison.floating-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(212, 175, 55, 0.4);
}

/* Comparison Container */
.comparison-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    display: none;
    animation: fadeIn 0.3s ease;
}

.comparison-container.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.comparison-container > div {
    background: var(--color-bg-primary);
    height: 100vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

/* Comparison Header */
.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--color-gold-deep), var(--color-gold));
    color: var(--color-bg-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.comparison-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-family: var(--font-heading);
}

.comparison-controls {
    display: flex;
    gap: 0.5rem;
}

.comparison-controls button {
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    color: var(--color-bg-primary);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.comparison-controls button:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Profiles Grid */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Profile Card */
.profile-card {
    background: var(--color-glass-surface);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.profile-card:hover {
    box-shadow: var(--shadow-glass);
}

.profile-card.calculated {
    border-color: var(--color-success);
    background: rgba(74, 222, 128, 0.05);
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.profile-name {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-weight: 600;
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
}

.btn-remove-profile {
    background: var(--color-error);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.btn-remove-profile:hover {
    background: #DC2626;
}

/* Profile Input */
.profile-input .input-group {
    margin-bottom: 1rem;
}

.profile-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.date-inputs {
    display: flex;
    gap: 0.5rem;
}

.date-inputs select {
    flex: 1;
}

.profile-input select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
}

.gender-inputs {
    display: flex;
    gap: 1rem;
}

.gender-inputs label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn-calculate-profile {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-deep));
    color: var(--color-bg-primary);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-calculate-profile:hover {
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}

/* Profile Result */
.profile-result {
    padding: 1rem;
    background: var(--color-bg-secondary);
    border-radius: 8px;
}

.result-summary .birth-info {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.pillars-display {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.pillars-display .pillar {
    text-align: center;
    padding: 0.5rem;
    background: var(--color-bg-tertiary);
    border-radius: 6px;
    border: 1px solid var(--color-border);
    min-height: auto;
}

.pillars-display .pillar-title {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.stem, .branch {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.stem.day-master {
    color: var(--color-gold);
}

/* Elements Mini Display */
.elements-bars-mini {
    margin-top: 1rem;
}

.element-bar-mini {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.element-name {
    width: 30px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.bar-container {
    flex: 1;
    height: 16px;
    background: var(--color-bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.element-count {
    width: 20px;
    text-align: right;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

/* Comparison Tabs */
.comparison-tabs {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.tabs-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--color-text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--color-text-primary);
}

.tab-btn.active {
    color: var(--color-gold);
    border-bottom-color: var(--color-gold);
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

/* Overview Tab */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.overview-card {
    background: var(--color-glass-surface);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--color-border);
}

.overview-card h4 {
    margin: 0 0 1rem 0;
    color: var(--color-gold);
}

.overview-details .detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.detail-item .label {
    color: var(--color-text-muted);
}

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

/* Compatibility Table */
.compatibility-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-glass-surface);
    border-radius: 8px;
    overflow: hidden;
}

.compatibility-table th,
.compatibility-table td {
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--color-border);
}

.compatibility-table thead th {
    background: var(--color-bg-secondary);
    font-weight: 600;
    color: var(--color-gold);
}

.compatibility-table tbody th {
    background: var(--color-bg-secondary);
    font-weight: 600;
    color: var(--color-text-primary);
}

.compatibility-table td.self {
    background: var(--color-bg-tertiary);
    color: var(--color-text-muted);
}

.compatibility-table td.excellent {
    background: rgba(74, 222, 128, 0.1);
    color: var(--color-success);
    font-weight: 600;
}

.compatibility-table td.good {
    background: rgba(251, 191, 36, 0.1);
    color: var(--color-warning);
    font-weight: 600;
}

.compatibility-table td.average {
    background: rgba(248, 113, 113, 0.1);
    color: var(--color-error);
    font-weight: 600;
}

/* Detailed Table */
.detailed-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-glass-surface);
    border-radius: 8px;
    overflow: hidden;
}

.detailed-table th,
.detailed-table td {
    padding: 0.75rem;
    border: 1px solid var(--color-border);
}

.detailed-table thead th {
    background: var(--color-bg-secondary);
    font-weight: 600;
    color: var(--color-gold);
}

.detailed-table tbody th {
    background: var(--color-bg-secondary);
    font-weight: 600;
    color: var(--color-text-primary);
    text-align: left;
}

.detailed-table td {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--color-text-primary);
}

/* Charts Container */
#elements-comparison-chart {
    max-width: 500px;
    height: 400px;
    margin: 0 auto;
}

/* Notification */
.comparison-notification {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    z-index: 2000;
    transition: top 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--color-border);
}

.comparison-notification.show {
    top: 20px;
}

/* No Data Message */
.no-data {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
    font-style: italic;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .profiles-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .comparison-header {
        flex-direction: column;
        gap: 1rem;
    }

    .comparison-controls {
        width: 100%;
        justify-content: space-between;
    }

    .profiles-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .tabs-header {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1;
        min-width: 100px;
        font-size: 0.9rem;
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .btn-comparison.floating-btn {
        bottom: 60px;
        right: 10px;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .comparison-header h2 {
        font-size: 1.2rem;
    }

    .pillars-display {
        grid-template-columns: repeat(2, 1fr);
    }
}
