:root {
    /* Harmony Red & Green Theme */
    --app-bg: #fdfbf7;
    --panel-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.05);
    --text-primary: #2c2c2c;
    --text-secondary: #5a5a5a;

    --accent-red: #d63b1d;
    --accent-green: #27c93f;
    --accent-gold: #c5a059;
    --error-red: #ff3b30;
    --success-green: #34c759;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);

    --font-family: "Noto Serif SC", "Outfit", serif;
    --font-mono: "JetBrains Mono", monospace;
    --font-title: "Ma Shan Zheng", cursive;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--app-bg);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url('https://images.unsplash.com/photo-1497436072909-60f360e1d4b1?q=80&w=2560&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
}

.app-container {
    width: 95vw;
    height: 90vh;
    max-width: 1800px;
    background: rgba(255, 252, 245, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.main-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.5);
}

.header-content h1 {
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 400;
    color: var(--accent-red);
}

.highlight {
    color: var(--accent-gold);
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: -5px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.apple-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-family: var(--font-family);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    font-size: 0.9rem;
}

.primary-btn {
    background: var(--accent-red);
    color: white;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(214, 59, 29, 0.3);
}

.secondary-btn {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.secondary-btn:hover {
    background: #f5f5f5;
}

.apple-select {
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    font-family: var(--font-family);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.apple-select:hover {
    background: #f5f5f5;
}

/* Content Area */
.content-area {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2px;
    background: rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.graph-panel,
.properties-panel {
    background: var(--panel-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.4);
}

.panel-header h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
}

.panel-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Graph View */
.graph-container {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
}

.graph-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
}

.nodes-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.graph-node {
    position: absolute;
    width: 50px;
    height: 50px;
    background: #fff;
    border: 2px solid var(--accent-red);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-title);
    font-size: 1.3rem;
    color: var(--accent-red);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
}

.graph-node:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.graph-node.selecting {
    background: var(--accent-gold);
    color: white;
    border-color: var(--accent-gold);
}

.graph-edge {
    stroke: var(--accent-red);
    stroke-width: 2;
    fill: none;
    marker-end: url(#arrowhead);
    opacity: 0.6;
    cursor: pointer;
    transition: all 0.3s ease;
}

.graph-edge:hover {
    opacity: 1;
    stroke-width: 3;
}

.graph-edge.self-loop {
    stroke-width: 2.5;
    opacity: 0.7;
}

.graph-edge.symmetric-pair {
    stroke: var(--success-green);
    marker-end: url(#arrowhead-green);
    opacity: 0.8;
}

.graph-edge.violation {
    stroke: var(--error-red);
    marker-end: url(#arrowhead-red);
    opacity: 0.9;
    stroke-dasharray: 5, 5;
    animation: dash 20s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -1000;
    }
}

/* Properties Panel */
.properties-panel {
    overflow-y: auto;
}

.properties-grid {
    padding: 24px;
    display: grid;
    gap: 16px;
}

.property-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    border: 2px solid transparent;
    transition: all 0.4s ease;
    box-shadow: var(--shadow-sm);
}

.property-card.satisfied {
    border-color: var(--success-green);
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.05), rgba(52, 199, 89, 0.02));
}

.property-card.violated {
    border-color: var(--error-red);
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.05), rgba(255, 59, 48, 0.02));
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.card-icon {
    font-size: 1.8rem;
}

.card-title {
    flex-grow: 1;
}

.card-title h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.card-title p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

.card-status {
    font-size: 1.5rem;
    font-weight: 700;
    transition: all 0.3s;
}

.card-status.check {
    color: var(--success-green);
}

.card-status.cross {
    color: var(--error-red);
}

.card-body {
    padding-left: 48px;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.card-math {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-gold);
    background: rgba(197, 160, 89, 0.1);
    padding: 6px 10px;
    border-radius: 6px;
    display: inline-block;
}

.card-feedback {
    margin-top: 8px;
    font-size: 0.8rem;
    padding: 8px;
    border-radius: 6px;
    display: none;
}

.card-feedback.show {
    display: block;
}

.card-feedback.error {
    background: rgba(255, 59, 48, 0.1);
    color: var(--error-red);
    border-left: 3px solid var(--error-red);
}

.card-feedback.success {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success-green);
    border-left: 3px solid var(--success-green);
}