/* Base Styles */
:root {
    --bg-dark: #08090a;
    --bg-panel: #242424;
    --bg-input: #141414;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent-green: #4ade80;
    --accent-red: #ef4444;
    --accent-blue: #60a5fa;
    --border-color: #3d3d3d;
    --accent-yellow: #fbff00;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.5s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

h1, h2, h3 {
    font-family: 'Minecraft', 'Segoe UI', sans-serif;
    text-align: center;
    margin-bottom: 1.5rem;
}

h1 {
    color: var(--accent-green);
    font-size: 2.5rem;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

/* Calculator Container */
.calculator-container {
    background-color: var(--bg-panel);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
}

/* Panel Layout */
.panel-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
}

.panel {
    flex: 1;
    background-color: var(--bg-input);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    padding: 0;
    overflow: hidden;
    height: 180px;
}

.panel:hover {
    border-color: var(--accent-yellow);
    box-shadow: 0 5px 25px rgba(255, 255, 255, 0.5);
}

.overworld-panel:hover {
    background-color: rgba(74, 126, 222, 0.15); /* Dark green with low opacity */
}

.nether-panel:hover {
    background-color: rgba(239, 68, 68, 0.15); /* Dark red with low opacity */
}

.overworld-panel.active {
    background-color: rgba(74, 126, 222, 0.3); /* Slightly stronger for active state */
    border-color: var(--accent-blue);
}

.nether-panel.active {
    background-color: rgba(239, 68, 68, 0.3); /* Slightly stronger for active state */
    border-color: var(--accent-red);
}

.panel.active {
    border-color: #ffffff;
    box-shadow: 0 5px 25px rgba(255, 255, 255, 0.5);
}

.overworld-panel.active {
    background-color: rgba(74, 126, 222, 0.3); /* Maintain the green background */
    border-color: var(--accent-blue);
}

.nether-panel.active {
    background-color: rgba(239, 68, 68, 0.3); /* Maintain the red background */
    border-color: var(--accent-red);
}

.currently-selected {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    display: none;
    /* border: 1px solid var(--accent-yellow); */
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.overworld-panel .currently-selected {
    color: var(--accent-blue);
}

.nether-panel .currently-selected {
    color: var(--accent-red);
}

.panel h2 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 8px 16px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    z-index: 1;
    font-size: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.overworld-panel h2 {
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}

.nether-panel h2 {
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
}

.panel-image {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.panel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Question Panel */
.question-panel {
    flex: 0.5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question {
    text-align: center;
}

.arrow-container {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.arrow {
    font-size: 2rem;
    color: var(--text-secondary);
}

.left-arrow {
    color: var(--accent-blue);
}

.right-arrow {
    color: var(--accent-red);
}

/* Coordinate Sections */
.coord-container {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.coord-section {
    flex: 1;
    background-color: var(--bg-input);
    border-radius: 8px;
    border: 1px solid var(--bg-dark);
    padding: 1.5rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5) !important;
    transition: all 0.3s ease;
}

.coord-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.overworld-section h3 {
    color: var(--accent-blue);
}

.nether-section h3 {
    color: var(--accent-red);
}

.input-area, .result-area {
    margin-bottom: 1rem;
}

.input-group {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.input-group, .result {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    height: 38px; /* Fixed height for both input and result rows */
}

.input-group label, .result span:first-child {
    width: 2rem;
    font-weight: bold;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.input-group input, .result span:last-child {
    flex: 1;
    height: 38px;
    padding: 0.6rem;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 1rem;
    box-sizing: border-box;
}

.input-group label {
    width: 2rem;
    font-weight: bold;
}

.input-group input {
    flex: 1;
    padding: 0.6rem;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 1rem;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.2);
}

/* Styling for result areas when shown standalone */
.standalone-result {
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
}

.result {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.result span:first-child {
    font-weight: bold;
    width: 2rem; /* Match the width of labels in input-group */
}

.result span:last-child {
    display: flex;
    align-items: center;
    font-family: monospace;
}

/* Export Area */
.export-container {
    background-color: var(--bg-input);
    border-radius: 8px;
    border: 1px solid var(--bg-dark);
    padding: 1.5rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5) !important;
}

.export-section {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.export-box {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    min-height: 80px;
    flex-grow: 1;
    white-space: pre-wrap;
    font-family: monospace;
    color: var(--text-secondary);
}

#copy-button {
    padding: 0.6rem 1.2rem;
    background-color: #2b6d99;
    color: black;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
}

#copy-button:hover {
    background-color: #b1af46;
}

#copy-button:active {
    transform: translateY(0);
}

/* Footer */
footer {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 2rem;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .panel-container {
        flex-direction: column;
    }
    
    .coord-container {
        flex-direction: column;
    }
    
    .question-panel {
        margin: 1rem 0;
    }
    
    .arrow-container {
        flex-direction: row;
        justify-content: space-around;
    }
    
    .arrow {
        transform: rotate(90deg);
    }
}

/* Help Box */
.help-box {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.help-box h3 {
    color: var(--accent-blue);
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 0.8rem;
    text-align: left;
}

.help-box p {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.help-box p:last-child {
    margin-bottom: 0;
}

/* Background color overrides with high specificity */
.calculator-container.overworld-mode {
    background-color: #0a121f !important; /* Dark blue */
    border: 2px solid rgba(74, 138, 222, 0.3) !important;
    box-shadow: 0 0 20px rgba(74, 113, 222, 0.15) !important;
}

.calculator-container.nether-mode {
    background-color: #1f0a0a !important; /* Dark red */
    border: 2px solid rgba(239, 68, 68, 0.3) !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15) !important;
}

/* Add transition for smooth color changes */
.calculator-container {
    transition: background-color 0.5s ease, border 0.5s ease, box-shadow 0.5s ease !important;
}

/* Highlight coordinate panels based on active dimension */
.calculator-container.overworld-mode .overworld-section {
    border: 2px solid var(--accent-blue) !important;
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.3) !important;
}

.calculator-container.nether-mode .nether-section {
    border: 2px solid var(--accent-red) !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3) !important;
}

/* Add transition for coordinate panels */
.coord-section {
    transition: border 0.3s ease, box-shadow 0.3s ease !important;
}