/* Modern styling for CoolProp application */

* {
    box-sizing: border-box;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(102, 126, 234, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-spinner p {
    margin-top: 50px;
    font-size: 1.2em;
    font-weight: 500;
}

/* 3D Cube Animation */
.block2 {
    position: relative;
    width: 200px;
    height: 200px;
    perspective: 1000px;
}

.shape {
    width: 100px;
    height: 100px;
}

.cube {
    position: relative;
    transition: transform .5s;
    transform-style: preserve-3d;
}

.cube.outer {
    width: 200px;
    height: 200px;
    transform-style: preserve-3d;
    animation: spin 4s infinite cubic-bezier(.67,.03,.31,.98);
}

.cube.outer > .cube {
    position: absolute;
    width: 100px;
    height: 100px;
    top: 50%;
    left: 50%;
    transform-origin: center center;
    transform: translate(-50%, -50%);
    animation: spin-inner 4s infinite cubic-bezier(.67,.03,.31,.98);
}

.side {
    position: absolute;
    width: 100%;
    height: 100%;
    font-size: 30px;
    line-height: 100px;
    text-align: center;
    opacity: .9;
    transition: all .2s linear;
    border: 2px solid #FFFFFF;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 100% 0 rgba(255, 255, 255, .3);
    box-sizing: border-box;
}

.outer > .cube .side {  
    background: rgba(255, 255, 255, 0.15);
}

.side.left {
    transform: translateX(-50px) rotateY(-90deg);  
}

.cube.outer > .side.left {
    transform: translateX(-100px) rotateY(-90deg);  
}

.side.right {
    transform: translateX(50px) rotateY(90deg);  
}

.cube.outer > .side.right {
    transform: translateX(100px) rotateY(90deg);  
}

.side.top { 
    transform: translateY(-50px) rotateX(90deg);  
}

.cube.outer > .side.top {
    transform: translateY(-100px) rotateX(90deg);  
}

.side.bottom { 
    transform: translateY(50px) rotateX(-90deg);  
}

.cube.outer > .side.bottom {
    transform: translateY(100px) rotateX(-90deg);  
}

.side.front {
    transform: translateZ(50px); 
}

.cube.outer > .side.front {
    transform: translateZ(100px);  
}

.side.back {  
    transform: translateZ(-50px) rotateX(180deg);
}

.cube.outer > .side.back {
    transform: translateZ(-100px) rotateX(180deg); 
}

@keyframes spin {  
    0% {
        transform: rotateX(0deg) rotateY(0deg);
    }
    33.333% {
        transform: rotateX(-35deg) rotateY(-45deg);
    }
    66.666% {
        transform: rotateX(-35deg) rotateY(45deg);
    }  
    100% {
        transform: rotateX(0deg) rotateY(0deg);
    }
}

@keyframes spin-inner {
    0% {
        transform: translate(-50%, -50%) rotateY(0deg) rotateX(90deg);
    }
    33.333% {
        transform: translate(-50%, -50%) rotateY(90deg) rotateX(90deg);
    }
    66.666% {
        transform: translate(-50%, -50%) rotateY(-90deg) rotateX(90deg);
    }
    100% {
        transform: translate(-50%, -50%) rotateY(0deg) rotateX(90deg);
    }
}

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

h1 {
    margin: 0;
    color: #667eea;
    font-size: 2.5em;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    color: #666;
    margin-top: 8px;
    font-size: 1.1em;
}

.fluid-selection-section {
    margin-bottom: 30px;
}

.main-content-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
    align-items: start;
}

.inputs-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.diagram-column {
    position: sticky;
    top: 20px;
}

@media (max-width: 1024px) {
    .main-content-grid {
        grid-template-columns: 1fr;
    }
    
    .diagram-column {
        position: static;
    }
}

.section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.section-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 0.95em;
}

.form-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.form-row select,
.form-row input {
    flex: 1;
}

select, input[type="text"], input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

select:focus, input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select:hover, input:hover {
    border-color: #999;
}

button#calc {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin-top: 10px;
    width: 100%;
}

button#calc:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

button#calc:active {
    transform: translateY(0);
}

.output-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.output-section label {
    display: block;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1em;
}

#output {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    line-height: 1.8;
    color: #333;
    min-height: 50px;
}

.diagram-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.diagram-section label {
    display: block;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1em;
}

#tsDiagram {
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: block;
}

.ui-widget {
    font-family: inherit;
}

.ui-widget select,
.ui-widget input {
    font-family: inherit;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .main-content-grid {
        gap: 20px;
    }
    
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Footer */
footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

footer p {
    margin: 0;
}

footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Smooth transitions */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
