/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f0f8ff;
    background: linear-gradient(135deg, #e0f7fa 0%, #f0f8ff 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    color: #2c3e50;
    padding: 20px;
}

.hidden {
    display: none !important;
}

.active {
    display: flex !important;
}

/* Login Screen */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e0f7fa 0%, #f0f8ff 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-container {
    background-color: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 450px;
    width: 90%;
}

.login-container h1 {
    color: #1a5276;
    margin-bottom: 1rem;
    font-size: 2.2rem;
}

.login-form {
    margin-top: 2rem;
}

.login-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 1.2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.login-form input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    outline: none;
}

.login-form button {
    background-color: #2980b9;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    font-size: 1rem;
    font-weight: bold;
}

.login-form button:hover {
    background-color: #3498db;
    transform: translateY(-2px);
}

.login-form button:active {
    transform: translateY(0);
}

.error-message {
    color: #e74c3c;
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Main App Container */
#app-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 10px;
    width: 100%;
}

header h1 {
    color: #1a5276;
    margin-bottom: 0.2rem;
    font-size: 2.2rem;
}

/* Author attribution */
.author {
    font-style: italic;
    color: #666;
    margin-bottom: 15px;
    font-size: 1rem;
    text-align: center;
}

/* App Description */
.app-description {
    max-width: 800px;
    margin: 0 auto 20px;
    padding: 10px 15px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    font-size: 0.9rem;
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    max-width: 300px;
    opacity: 0.9;
}

.app-description p {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #34495e;
}

/* Instructions */
.instructions {
    max-width: 300px;
    margin: 0;
    padding: 10px 15px;
    background-color: rgba(52, 152, 219, 0.1);
    border-left: 4px solid #3498db;
    border-radius: 5px;
    text-align: left;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    opacity: 0.9;
}

.instructions h3 {
    color: #2980b9;
    margin-bottom: 5px;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.instructions h3 i {
    margin-right: 8px;
}

.instructions p {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #34495e;
}

/* Triangle Container */
#triangle-container {
    position: relative;
    width: 100%;
    flex: 1;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    padding: 20px;
    min-height: 800px !important;
    min-width: 1200px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

#triangle-container::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
}

/* Add arrow marker definitions */
#triangle-container::after {
    content: '';
    position: fixed;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* State Nodes */
.state-node {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background-color: white;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 4px solid transparent;
}

.state-node:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: #3498db;
}

#solid-state {
    bottom: 50px;
    left: 20%;
    border-color: #A5F2F3;
}

#liquid-state {
    bottom: 50px;
    right: 20%;
    border-color: #4FC3F7;
}

#gas-state {
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    border-color: #E1F5FE;
}

#gas-state:hover {
    transform: translateX(-50%) scale(1.05);
}

.state-image {
    width: 90px;
    height: 90px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-bottom: 8px;
}

#solid-image {
    background-image: url('images/ice.png');
}

#liquid-image {
    background-image: url('images/water.png');
}

#gas-image {
    background-image: url('images/vapor.png');
}

.state-label {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    top: -14px;
    position: relative;
    width: 60px;
    text-align: center;
}

/* Transition Paths with Arrows */
.transition-path {
    position: absolute;
    background-color: currentColor;
    height: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
    border-radius: 2px;
}

.transition-path::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid currentColor;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
}

.transition-path.endothermic {
    color: #e74c3c;
}

.transition-path.exothermic {
    color: #3498db;
}

.transition-path:hover {
    height: 6px;
}

.transition-label {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    color: #2c3e50;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 1;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.transition-path:hover .transition-label {
    background-color: rgba(37, 141, 16, 0.1);
    color: #258d10;
}

/* Specific transition paths positioning */
#melting-path {
    width: 380px;
    bottom: 120px;
    left: calc(20% + 160px);
    transform: rotate(0deg);
}

#freezing-path {
    width: 380px;
    bottom: 70px;
    left: calc(20% + 179px);
    transform: rotate(0deg);
}

#freezing-path div.transition-label {
    top: 8px;
    left: calc(50% - 19px);
}

#evaporation-path {
    width: 400px;
    bottom: 385px;
    right: calc(20% + 20px);
    transform: rotate(60deg);
}

#evaporation-path div.transition-label {
    top: 8px;
}

#condensation-path {
    width: 400px;
    bottom: 400px;
    right: calc(20% + -15px);
    transform: rotate(60deg);
}

#sublimation-path {
    width: 400px;
    bottom: 385px;
    left: calc(20% + 20px);
    transform: rotate(-60deg);
}

#sublimation-path div.transition-label {
    top: 8px;
}

#deposition-path {
    width: 400px;
    bottom: 400px;
    left: calc(20% + -15px);
    transform: rotate(-60deg);
}

/* Arrow positions for each path */
#melting-path::after {
    right: 0;
    transform: translateX(19px) translateY(-50%) rotate(0deg);
}

#freezing-path::after {
    right: auto;
    left: 0;
    transform: translateX(-19px) translateY(-50%) rotate(180deg);
}

#evaporation-path::after {
    right: 0;
    transform: translateX(-399px) translateY(-50%) rotate(180deg);
}

#condensation-path::after {
    right: auto;
    left: 0;
    transform: translateX(399px) translateY(-50%) rotate(0deg);
}

#sublimation-path::after {
    right: 0;
    transform: translateX(19px) translateY(-50%) rotate(0deg);
}

#deposition-path::after {
    right: auto;
    left: 0;
    transform: translateX(-19px) translateY(-50%) rotate(180deg);
}

/* Modal */
#transition-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    padding: 2.5rem;
    border-radius: 15px;
    max-width: 850px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-button:hover {
    color: #e74c3c;
    background-color: rgba(0, 0, 0, 0.05);
}

#transition-title {
    color: #1a5276;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

#animation-container {
    width: 100%;
    height: 350px;
    margin: 25px 0;
    background-color: #f9f9f9;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

#transition-description {
    margin-top: 25px;
    line-height: 1.7;
    color: #34495e;
    font-size: 1.05rem;
}

#transition-description h3 {
    color: #1a5276;
    margin: 15px 0 10px;
}

/* Temperature Control Styles */
.temperature-control {
    margin: 25px 0;
    padding: 20px;
    background-color: #f5f5f5;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.temperature-control h3 {
    margin-bottom: 15px;
    color: #1a5276;
    font-size: 1.3rem;
}

.slider-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.temp-label {
    font-weight: bold;
    margin: 0 15px;
    font-size: 1.1rem;
}

.cold {
    color: #3498db;
}

.hot {
    color: #e74c3c;
}

.temp-slider {
    width: 70%;
    height: 12px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #3498db, #e74c3c);
    outline: none;
    border-radius: 6px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.temp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 2px solid #3498db;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.temp-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 2px solid #3498db;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Thermometer Visualization */
.thermometer {
    display: inline-block;
    position: relative;
    width: 40px;
    height: 120px;
    margin: 0 auto;
}

.thermometer-bulb {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    background-color: #e74c3c;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.thermometer-stem {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 100px;
    background-color: #f5f5f5;
    border: 2px solid #ccc;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.thermometer-level {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #e74c3c;
    transition: height 0.3s ease;
}

/* Heat and Cool Source Styles */
.heat-source, .cool-source {
    transition: opacity 0.3s ease;
    box-shadow: 0 0 15px 5px rgba(255, 165, 0, 0.5);
}

.cool-source {
    box-shadow: 0 0 15px 5px rgba(100, 200, 255, 0.5);
}

/* Animation State Images */
.state-image-container {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.state-image-container img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.initial-state, .final-state {
    opacity: 0;
}

/* Responsive Design */
@media (max-width: 992px) {
    #triangle-container {
        /* min-height: 500px; */
    }
}

@media (max-width: 768px) {
    /* #triangle-container {
        min-height: 450px;
    }
    
    .state-node {
        width: 110px;
        height: 110px;
    }
    
    .state-image {
        width: 70px;
        height: 70px;
    }
    
    #solid-state {
        bottom: 40px;
    }
    
    #liquid-state {
        bottom: 40px;
    }
    
    #gas-state {
        top: 40px;
    }
    
    #melting-path, #freezing-path {
        width: 200px;
        bottom: 90px;
        left: calc(20% + 55px);
    }
    
    #freezing-path {
        bottom: 70px;
    }
    
    #evaporation-path, #condensation-path {
        width: 300px;
        bottom: 200px;
    }
    
    #sublimation-path, #deposition-path {
        width: 300px;
        bottom: 200px;
    } 
    
    .temperature-control {
        padding: 15px;
    }
    
    .thermometer {
        height: 100px;
    }
    
    .thermometer-stem {
        height: 80px;
    }
    
    .app-description, .instructions {
        position: static;
        max-width: 100%;
        margin-bottom: 15px;
    } */
}

@media (max-width: 576px) {
    /* header h1 {
        font-size: 1.8rem;
    }
    
    #triangle-container {
        min-height: 400px;
        padding: 10px;
    }
    
    .state-node {
        width: 90px;
        height: 90px;
    }
    
    .state-image {
        width: 50px;
        height: 50px;
    }
    
    .state-label {
        font-size: 12px;
    }
    
    #melting-path, #freezing-path {
        width: 150px;
        left: calc(20% + 45px);
    }
    
    #evaporation-path, #condensation-path,
    #sublimation-path, #deposition-path {
        width: 220px;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
    
    #transition-title {
        font-size: 1.5rem;
    }
    
    #animation-container {
        height: 250px;
    }
    
    .temperature-control h3 {
        font-size: 1.1rem;
    }
    
    .temp-label {
        font-size: 0.9rem;
        margin: 0 8px;
    }
    
    .thermometer {
        height: 80px;
    }
    
    .thermometer-stem {
        height: 60px;
        width: 10px;
    }
    
    .thermometer-bulb {
        width: 20px;
        height: 20px;
    } */
} 