:root {
    --primary-color: #3498db;
    --secondary-color: #e74c3c;
    --accent-color: #f39c12;
    --background-color: #f5f7fa;
    --panel-color: #ffffff;
    --text-color: #333333;
    --border-color: #dddddd;
    --hover-color: #2980b9;
    --shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.construccion {
    background-color: #9b5951;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 6px;
    width: 100%;
    margin: 0;
}

.construccion svg {
    margin-right: 10px;
}

.construccion p {
    font-weight: 500;
    color: white;
    font-size: 1.2rem;
}


header {
    background-color: var(--panel-color);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-container {
    margin-bottom: 0.5rem;
}

.logo {
    height: 60px;
}

h1 {
    font-size: 1.8rem;
    color: var(--text-color);
}

.container {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1rem;
}

.simulation-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.pendulum-simulation {
    flex: 1;
    min-width: 300px;
    height: 400px;
    background-color: var(--panel-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: hidden;
    position: relative;
}

#pendulum-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#pivot {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background-color: #555;
    border-radius: 50%;
}

#string {
    position: absolute;
    top: 15px;
    left: 50%;
    width: 2px;
    height: 200px;
    background-color: #333;
    transform-origin: top center;
    transform: translateX(-50%) rotate(0deg);
}

#bob {
    position: absolute;
    width: 30px;
    height: 30px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    transform-origin: center;
    transform: translate(-50%, -50%);
    left: 50%;
    top: 215px;
}

.control-panel {
    flex: 1;
    min-width: 300px;
    background-color: var(--panel-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1rem;
}

.parameter-section, .simulation-options {
    margin-bottom: 1rem;
}

h3 {
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.parameter, .option {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.parameter label, .option label {
    flex: 1;
    min-width: 150px;
    font-weight: 500;
}

input[type="range"] {
    flex: 2;
    margin: 0 1rem;
    height: 5px;
    background-color: var(--border-color);
    border-radius: 5px;
    outline: none;
}

.toggle-button {
    background-color: var(--border-color);
    color: var(--text-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-button.active {
    background-color: var(--accent-color);
    color: white;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.primary-button, .secondary-button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.primary-button {
    background-color: var(--primary-color);
    color: white;
    flex: 1;
}

.primary-button:hover {
    background-color: var(--hover-color);
}

.primary-button:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
}

.secondary-button {
    background-color: var(--panel-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.secondary-button:hover {
    background-color: var(--background-color);
}

.data-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.measurement-table {
    background-color: var(--panel-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1rem;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th, td {
    padding: 0.6rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

th {
    background-color: var(--background-color);
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.measurement-input {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
}

.measurement-input label {
    margin-right: 1rem;
    font-weight: 500;
}

input[type="number"] {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 100px;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.stats-panel {
    background-color: var(--panel-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1rem;
}

.stats-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#stats-display {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

#basic-stats {
    flex: 1;
    min-width: 250px;
    background-color: var(--background-color);
    padding: 1rem;
    border-radius: 4px;
}

#plot-container {
    flex: 2;
    min-width: 300px;
    height: 600px;
    background-color: var(--background-color);
    border-radius: 4px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--panel-color);
    margin: 10% auto;
    padding: 1.5rem;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    box-shadow: var(--shadow);
    position: relative;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
}

#login-section, #admin-panel {
    margin-top: 1rem;
}

#admin-password {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 100%;
    margin-bottom: 0.5rem;
}

#login-button {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.error-message {
    color: var(--secondary-color);
    margin-top: 0.5rem;
}

#real-values {
    background-color: var(--background-color);
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

footer {
    background-color: var(--panel-color);
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
}

.hidden {
    display: none;
}

.language-selector {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
}

.language-dropdown {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--panel-color);
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .simulation-container {
        flex-direction: column;
    }
    
    .pendulum-simulation, .control-panel {
        width: 100%;
    }
    
    .pendulum-simulation {
        height: 350px;
        order: -1; 
        min-height: 300px; 
        overflow: visible; 
    }
    
    #pendulum-container {
        position: relative;
        width: 100%;
        height: 100%;
        min-height: 300px; 
    }
    
    #string {
        display: block; 
    }
    
    #bob {
        display: block; 
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .parameter, .option {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .parameter label, .option label {
        margin-bottom: 0.3rem;
        width: 100%;
    }
    
    input[type="range"] {
        width: 100%;
        margin: 0.5rem 0;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .action-buttons button {
        margin-bottom: 0.5rem;
        height: 44px; 
        width: 100%;
    }
    
    .table-actions {
        flex-direction: column;
    }
    
    .table-actions button {
        width: 100%;
        margin-bottom: 0.5rem;
        height: 44px; 
    }
    
    .measurement-input {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .measurement-input label {
        margin-bottom: 0.5rem;
        width: 100%;
    }
    
    .measurement-input input[type="number"] {
        width: 100%;
        height: 44px; 
        font-size: 16px; 
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    #login-button, #logout-button {
        height: 44px; 
        width: 100%;
    }
    
    .language-selector {
        top: 5px;
        right: 5px;
    }
    
    .language-dropdown {
        height: 36px;
        font-size: 14px;
    }
    
    footer {
        font-size: 0.8rem;
        padding: 0.8rem;
    }
    
    #stats-display {
        flex-direction: column;
    }
    
    #plot-container {
        height: 450px;
    }
}

/* Add new specific mobile fixes */
@media (max-width: 480px) {
    .pendulum-simulation {
        height: 300px;
        margin-bottom: 1rem;
        position: relative;
        z-index: 1; 
    }
    
    #pendulum-container {
        visibility: visible !important; 
        height: 100% !important;
    }
    
    #pivot, #string, #bob {
        visibility: visible !important; 
    }
}