/* VSEPR Model Visualization Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.vsepr-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

header .subtitle {
    font-size: 1.1em;
    opacity: 0.95;
}

main {
    padding: 40px;
}

/* Presets Selector */
.presets-selector {
    margin-bottom: 30px;
}

.presets-selector h3 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #667eea;
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.preset-btn {
    padding: 10px 15px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    background: #f0f0ff;
    transform: translateY(-2px);
    border-color: #764ba2;
}

.preset-btn.active {
    background: #667eea;
    color: white;
}

/* Canvas Layout */
.canvas-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    margin-bottom: 30px;
}

.canvas-container {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#vseprCanvas {
    width: 100%;
    height: 500px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 10px;
    cursor: grab;
}

#vseprCanvas:active {
    cursor: grabbing;
}

/* Molecule Info Panel */
.molecule-info-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.molecule-info-panel h4 {
    font-size: 1.2em;
    margin-bottom: 20px;
    color: #667eea;
}

.molecule-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-row span:first-child {
    color: #667eea;
    font-weight: 600;
}

.stat-value {
    color: #333;
    font-weight: 700;
    font-size: 1.1em;
}

/* Repulsion Info */
.repulsion-info {
    margin-bottom: 30px;
}

.repulsion-info h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: #667eea;
}

.repulsion-scale {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

.repulsion-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.repulsion-label {
    min-width: 200px;
    font-weight: 600;
    font-size: 0.95em;
}

.repulsion-bar {
    flex: 1;
    height: 25px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

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

.repulsion-item.strongest .bar-fill {
    background: linear-gradient(90deg, #ff6b6b 0%, #ee5a5a 100%);
}

.repulsion-item.strong .bar-fill {
    background: linear-gradient(90deg, #ffd93d 0%, #ff9500 100%);
}

.repulsion-item.weak .bar-fill {
    background: linear-gradient(90deg, #4ecdc4 0%, #44a08d 100%);
}

.repulsion-value {
    min-width: 80px;
    font-weight: 700;
    font-size: 0.9em;
}

.repulsion-note {
    font-style: italic;
    color: #666;
    font-size: 0.95em;
    text-align: center;
}

/* Controls Panel */
.controls-panel {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.controls-panel h3 {
    font-size: 1.5em;
    margin-bottom: 25px;
    color: #667eea;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.control-group select,
.control-group input[type="range"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    outline: none;
}

.control-group select:focus {
    border-color: #667eea;
}

.control-group input[type="range"] {
    height: 8px;
    padding: 0;
    border: none;
    background: #ddd;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.control-button {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-button.reset {
    background: #f5576c;
    color: white;
}

.control-button.reset:hover {
    background: #f3455c;
    transform: translateY(-2px);
}

.control-button.toggle {
    background: #4facfe;
    color: white;
}

.control-button.toggle:hover {
    background: #3a9bd9;
    transform: translateY(-2px);
}

.control-button.toggle.active {
    background: #00f2fe;
}

/* Toggle Options */
.toggle-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Formulas Section */
.formulas-section {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.formulas-section h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.formula-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.formula-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.formula-label {
    font-weight: 600;
    color: #333;
    min-width: 200px;
}

.formula {
    font-family: 'Courier New', monospace;
    background: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.95em;
    color: #667eea;
}

/* Legend Section */
.legend-section {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.legend-section h4 {
    color: #667eea;
    margin-bottom: 15px;
}

.legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 30px;
    height: 20px;
    border-radius: 4px;
}

.legend-color.central {
    background: radial-gradient(circle, #ffd93d 0%, #ff9500 100%);
}

.legend-color.ligand {
    background: radial-gradient(circle, #4ecdc4 0%, #44a08d 100%);
}

.legend-color.bonding-pair {
    background: radial-gradient(circle, #a8e6cf 0%, #56ab91 100%);
    border: 2px solid #2d6a4f;
}

.legend-color.lone-pair {
    background: radial-gradient(circle, #ffcccb 0%, #ff6b6b 100%);
    border: 2px solid #c0392b;
}

/* Geometry Table */
.geometry-table {
    padding: 40px;
    background: #f8f9fa;
    border-radius: 15px;
    margin-top: 30px;
}

.geometry-table h2 {
    color: #667eea;
    font-size: 2em;
    margin-bottom: 20px;
    text-align: center;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Educational Content */
.explanation {
    padding: 40px;
    background: white;
    border-radius: 15px;
    margin-top: 30px;
}

.explanation h2 {
    color: #667eea;
    font-size: 2em;
    margin-bottom: 20px;
}

.explanation h3 {
    color: #764ba2;
    font-size: 1.5em;
    margin-top: 25px;
    margin-bottom: 15px;
}

.explanation p {
    line-height: 1.8;
    margin-bottom: 15px;
    color: #555;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .canvas-wrapper {
        grid-template-columns: 1fr;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    main {
        padding: 20px;
    }

    .presets-grid {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .toggle-options {
        flex-direction: column;
    }

    .legend-items {
        grid-template-columns: 1fr;
    }

    .repulsion-item {
        flex-wrap: wrap;
    }

    .repulsion-label {
        min-width: 100%;
    }

    table {
        font-size: 0.85em;
    }

    th, td {
        padding: 8px;
    }
}