/* visualizations.css - Styles for atomic and hybridization visualizations */

/* Visualization section */
.visualization {
    height: 300px;
    background-color: #f9f9f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}

/* Atomic model visualization */
.atomic-model {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.nucleus {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background-color: #f44336;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.6);
    z-index: 10;
}

.electron-shell {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(33, 150, 243, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.electron {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #2196F3;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.8);
}

/* Hybridization visualization */
.hybridization-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.orbital {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 15px;
    border-radius: 50%;
    background-color: rgba(33, 150, 243, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.orbital:hover {
    transform: scale(1.1);
}

.orbital.hybrid {
    background-color: rgba(156, 39, 176, 0.2);
    border: 2px solid rgba(156, 39, 176, 0.5);
}

.orbital-label {
    position: absolute;
    bottom: -25px;
    font-size: 0.8rem;
    width: 100%;
    text-align: center;
}

.properties-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

/* Property chart - holds all bars */
.property-chart {
    width: 100%;
    height: 85%;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 20px 10px;
    border-bottom: 2px solid #ccc; /* Add a baseline */
    position: relative;
}

/* Individual property bar */
.property-bar {
    flex: 1;
    margin: 0 10px;
    background: linear-gradient(to top, #2196F3, #8BC34A);
    border-radius: 4px 4px 0 0;
    position: relative;
    min-width: 40px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.property-bar:hover {
    transform: scale(1.05);
    z-index: 5;
}

/* Property label at the bottom of the bar */
.property-label {
    position: absolute;
    bottom: -35px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    font-weight: bold;
    color: #333;
    transform: rotate(45deg);
    transform-origin: left top;
    white-space: nowrap;
}

/* Property value at the top of the bar */
.property-value {
    position: absolute;
    width: 100%;
    text-align: center;
    top: -25px;
    font-size: 0.9rem;
    font-weight: bold;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 2px 0;
    border-radius: 3px;
    box-shadow: 0 0 3px rgba(0,0,0,0.1);
}

/* Add measurement units */
.property-unit {
    font-size: 0.7rem;
    font-weight: normal;
    color: #666;
}

/* Add grid lines for better readability */
.grid-line {
    position: absolute;
    left: 0;
    width: 100%;
    border-top: 1px dashed #ddd;
    z-index: 1;
}

.grid-label {
    position: absolute;
    left: -35px;
    font-size: 0.7rem;
    color: #666;
}

/* Electron animation path */
.electron-path {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px dashed rgba(33, 150, 243, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .visualization {
        height: 280px;
    }
    
    .atomic-model {
        width: 180px;
        height: 180px;
    }
    
    .nucleus {
        width: 45px;
        height: 45px;
    }
    
    .orbital {
        width: 50px;
        height: 50px;
        margin: 0 10px;
    }
}

@media (max-width: 767px) {
    .visualization {
        height: 250px;
    }
    
    .atomic-model {
        width: 160px;
        height: 160px;
    }
    
    .nucleus {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .electron {
        width: 8px;
        height: 8px;
    }
    
    .orbital {
        width: 45px;
        height: 45px;
        margin: 0 10px;
        font-size: 0.9rem;
    }
    
    .orbital-label {
        font-size: 0.7rem;
        bottom: -20px;
    }
}

@media (max-width: 480px) {
    .visualization {
        height: 220px;
    }
    
    .atomic-model {
        width: 140px;
        height: 140px;
    }
    
    .nucleus {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }
    
    .electron {
        width: 6px;
        height: 6px;
    }
    
    .orbital {
        width: 35px;
        height: 35px;
        margin: 0 5px;
        font-size: 0.8rem;
    }
    
    .property-bar {
        max-width: 40px;
        margin: 0 3px;
    }
    
    .property-label {
        font-size: 0.6rem;
    }
    
    .property-value {
        font-size: 0.6rem;
    }
}

/* Animation effects for hybridization */
@keyframes hybridize {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.orbital.hybrid {
    animation: hybridize 3s infinite ease-in-out;
}

/* Electron glow effect */
.electron::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    box-shadow: 0 0 10px 2px rgba(33, 150, 243, 0.6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.3);
    }
    100% {
        opacity: 0.7;
        transform: scale(1);
    }
}

/* Energy level colors for electron shells */
.electron-shell:nth-child(2) {
    border-color: rgba(33, 150, 243, 0.5);
}

.electron-shell:nth-child(3) {
    border-color: rgba(76, 175, 80, 0.5);
}

.electron-shell:nth-child(4) {
    border-color: rgba(255, 193, 7, 0.5);
}

.electron-shell:nth-child(5) {
    border-color: rgba(255, 87, 34, 0.5);
}

.electron-shell:nth-child(6) {
    border-color: rgba(156, 39, 176, 0.5);
}

.electron-shell:nth-child(7) {
    border-color: rgba(233, 30, 99, 0.5);
}

.electron-shell:nth-child(8) {
    border-color: rgba(0, 188, 212, 0.5);
}


/* Applications tab styling */
#applications {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 20px;
}

#applications h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
}

#applications-list {
    list-style-type: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}

#applications-list li {
    background-color: white;
    padding: 12px 15px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

#applications-list li:before {
    content: '•';
    color: #2196F3;
    font-weight: bold;
    margin-right: 10px;
    font-size: 1.2rem;
}

#applications-list li:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

@media (max-width: 767px) {
    #applications-list {
        grid-template-columns: 1fr;
    }
}

/* Section headings and paragraph styling */
.tab-content h3 {
    margin: 15px 0 10px 0;
    font-size: 1.2rem;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

.tab-content p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 1rem;
}

/* Add a subtle card effect to text sections */
#electron-config-detail, 
#hybridization-detail, 
#properties-detail {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

#electron-config-detail:hover, 
#hybridization-detail:hover, 
#properties-detail:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.12);
}


/* Make visualizations responsive and scrollable if needed */
.visualization {
    overflow: auto;
    position: relative;
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}

.visualization:active {
    cursor: grabbing;
}

.atomic-model, 
.hybridization-container, 
.properties-container {
    min-width: 100%;
    min-height: 100%;
}

/* Enhance the orbital containers to be more responsive */
.hybridization-container > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    padding: 10px;
}

/* Make orbital more responsive */
.orbital {
    flex-shrink: 0;
    margin: 10px;
}

/* Property Chart Responsive Improvements */
.property-chart {
    min-width: 350px;
    padding-bottom: 30px;
}

/* media queries for responsiveness */
@media (max-width: 576px) {
    .visualization {
        height: 250px;
    }

    .atomic-model {
        transform: scale(0.85);
        transform-origin: center center;
    }

    .orbital {
        width: 40px;
        height: 40px;
        font-size: 0.7rem;
    }

    .orbital-label {
        font-size: 0.6rem;
        bottom: -18px;
    }

    .property-label {
        transform: rotate(60deg);
        bottom: -20px;
        font-size: 0.6rem;
    }
}

/* Reactions tab styling */
.reactions-container {
    padding: 0;
    background-color: transparent;
    margin-bottom: 20px;
}

.reaction-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.reaction-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.reaction-header {
    background-color: #2196F3;
    color: white;
    padding: 12px 15px;
    font-weight: bold;
    font-size: 1.1rem;
}

.reaction-body {
    padding: 15px;
}

.reaction-equation {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding: 12px;
    background-color: #f5f5f5;
    border-radius: 5px;
    overflow-x: auto;
    line-height: 1.8;
}

.reaction-description {
    color: #333;
    line-height: 1.5;
    margin-bottom: 15px;
    text-align: justify;
}

.reaction-conditions {
    background-color: #f5f5f5;
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.reaction-conditions h4 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #444;
}

.reaction-conditions ul {
    margin: 0;
    padding-left: 20px;
    font-size: 0.95rem;
}

.reaction-conditions li {
    margin-bottom: 5px;
}

.reaction-applications {
    font-style: italic;
    color: #444;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Reaction elements styling */
.reaction-state {
    font-size: 0.7em;
    font-style: italic;
    color: #666;
}

.reaction-arrow {
    margin: 0 10px;
    color: #2196F3;
    font-weight: bold;
    display: inline-block;
}

.reaction-equilibrium {
    letter-spacing: -2px;
    margin: 0 10px;
}

.reaction-plus {
    margin: 0 5px;
    color: #555;
}

/* No reactions message */
.no-reactions {
    text-align: center;
    padding: 25px;
    background-color: #f9f9f9;
    border-radius: 8px;
    color: #666;
    margin-bottom: 15px;
}

.no-reactions p {
    margin-bottom: 12px;
}

.no-reactions ul {
    text-align: left;
    display: inline-block;
    margin: 10px 0;
}

/* Reaction type badge */
.reaction-type-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: normal;
}

/* Filters for reactions */
.reaction-filters {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.reaction-filters h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #444;
    flex: 0 0 100%;
    margin-bottom: 5px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 0.9rem;
    color: #555;
    white-space: nowrap;
}

.filter-group select {
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: white;
    font-size: 0.9rem;
}

.reset-filters-btn {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
    margin-left: auto;
}

.reset-filters-btn:hover {
    background-color: #e0e0e0;
}

.reaction-count {
    text-align: right;
    font-size: 0.8rem;
    color: #777;
    margin-top: -5px;
    margin-bottom: 15px;
}

/* Dark mode support */
.dark-mode .reaction-card {
    background-color: #333;
}

.dark-mode .reaction-header {
    background-color: #1976D2;
}

.dark-mode .reaction-equation {
    background-color: #3a3a3a;
    color: #eee;
}

.dark-mode .reaction-description {
    color: #ddd;
}

.dark-mode .reaction-conditions {
    background-color: #3a3a3a;
}

.dark-mode .reaction-conditions h4 {
    color: #bbb;
}

.dark-mode .reaction-applications {
    color: #bbb;
}

.dark-mode .reaction-arrow {
    color: #64B5F6;
}

.dark-mode .reaction-plus {
    color: #aaa;
}

.dark-mode .no-reactions {
    background-color: #3a3a3a;
    color: #bbb;
}

.dark-mode .reaction-filters {
    background-color: #3a3a3a;
}

.dark-mode .reaction-filters h4 {
    color: #bbb;
}

.dark-mode .filter-group label {
    color: #aaa;
}

.dark-mode .filter-group select {
    background-color: #444;
    border-color: #555;
    color: #eee;
}

.dark-mode .reset-filters-btn {
    background-color: #444;
    border-color: #555;
    color: #eee;
}

.dark-mode .reset-filters-btn:hover {
    background-color: #555;
}

.dark-mode .reaction-count {
    color: #aaa;
}

/* Responsive styles */
@media (max-width: 768px) {
    .reaction-equation {
        font-size: 1rem;
        padding: 10px;
    }
    
    .reaction-header {
        font-size: 1rem;
        padding: 10px 15px;
    }
    
    .reaction-body {
        padding: 12px;
    }
    
    .reaction-filters {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-group {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .filter-group select {
        width: 100%;
    }
    
    .reset-filters-btn {
        width: 100%;
        margin-top: 10px;
        margin-left: 0;
    }
    
    .reaction-type-badge {
        top: 10px;
        right: 10px;
        font-size: 0.7rem;
        padding: 3px 7px;
    }
}

@media (max-width: 480px) {
    .reaction-equation {
        font-size: 0.9rem;
        padding: 8px;
        margin-bottom: 12px;
    }
    
    .reaction-header {
        font-size: 0.95rem;
        padding: 8px 12px;
    }
    
    .reaction-body {
        padding: 10px;
    }
    
    .reaction-conditions {
        padding: 10px;
    }
    
    .reaction-conditions h4 {
        font-size: 0.9rem;
    }
    
    .reaction-conditions ul {
        font-size: 0.85rem;
        padding-left: 15px;
    }
    
    .reaction-applications {
        font-size: 0.85rem;
    }
}

/* 3D Model tab styling */
.model-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: radial-gradient(circle, #2c3e50, #1a1a2e);
    display: flex;
    align-items: center;
    justify-content: center;
}

.model-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.model-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-weight: bold;
    color: #555;
}

.control-group select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: white;
    min-width: 150px;
}

.control-buttons {
    display: flex;
    gap: 10px;
}

.control-buttons button {
    padding: 8px 12px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.control-buttons button:hover {
    background-color: #1976D2;
}

/* Loading indicator for 3D model */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 5;
}

.loading-spinner {
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 5px solid #2196F3;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Legend for 3D model elements */
.model-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
    justify-content: center;
}

.legend-element {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 50%;
}

/* Help overlay for 3D controls */
.controls-help {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 0.8;
    z-index: 10;
}

/* Dark mode support */
.dark-mode .model-controls {
    background-color: #333;
}

.dark-mode .control-group label {
    color: #ddd;
}

.dark-mode .control-group select {
    background-color: #444;
    border-color: #555;
    color: #eee;
}

.dark-mode .controls-help {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Responsive styles for model controls */
@media (max-width: 768px) {
    .model-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    .control-group select {
        width: 100%;
    }
    
    .control-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    .controls-help {
        font-size: 0.7rem;
        padding: 5px 8px;
    }
}