* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: #1a1a1a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.main-wrapper {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    justify-content: center;
    align-items: flex-start;
}

.container {
    background: #2a2a2a;
    border: 2px solid #00ff41;
    border-radius: 10px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

h1 {
    color: #00ff41;
    text-align: center;
    margin-bottom: 10px;
    font-size: 28px;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

/* Screen reader only - hidden from view but readable by search engines and accessibility tools */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(0, 255, 65, 0.3);
    padding-bottom: 15px;
    position: relative;
    z-index: 10;
}

.mode-btn {
    flex: 1;
    padding: 10px;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid rgba(0, 255, 65, 0.3);
    color: rgba(0, 255, 65, 0.6);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer !important;
    border-radius: 5px;
    transition: all 0.3s;
    position: relative;
    z-index: 11;
    pointer-events: auto !important;
    opacity: 1 !important;
    display: inline-block;
}

.mode-btn:hover {
    background: rgba(0, 255, 65, 0.2);
}

.mode-btn:disabled {
    /* Override any disabled styles */
    opacity: 1 !important;
    cursor: pointer !important;
}

.mode-btn.active {
    background: rgba(0, 255, 65, 0.2);
    border-color: #00ff41;
    color: #00ff41;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.mode-screen {
    display: none;
}

.mode-screen.active {
    display: block;
}

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

label {
    color: #00ff41;
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input {
    width: 100%;
    padding: 12px;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid #00ff41;
    color: #00ff41;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    border-radius: 5px;
    outline: none;
    transition: all 0.3s;
}

input:focus {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

input::placeholder {
    color: rgba(0, 255, 65, 0.5);
}

.elevation-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.elevation-input-wrapper input[type="number"] {
    flex: 1;
}

.elevation-toggle-wrapper {
    display: flex;
    align-items: center;
}

.elevation-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding: 0 8px;
}

.toggle-text-plus,
.toggle-text-minus {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
}

.toggle-text-plus {
    color: #00ff66;
    opacity: 1;
}

.toggle-text-minus {
    color: #ff4444;
    opacity: 0.3;
}

.elevation-toggle-checkbox {
    display: none;
}

.elevation-toggle-slider {
    display: inline-block;
    width: 50px;
    height: 28px;
    background: rgba(0, 255, 102, 0.2);
    border: 2px solid #00ff66;
    border-radius: 14px;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 6px rgba(0, 255, 102, 0.2);
}

.elevation-toggle-slider::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #00ff66;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 0 8px rgba(0, 255, 102, 0.5);
}

.elevation-toggle-checkbox:checked + .elevation-toggle-slider {
    background: rgba(255, 68, 68, 0.2);
    border-color: #ff4444;
    box-shadow: inset 0 0 6px rgba(255, 68, 68, 0.2);
}

.elevation-toggle-checkbox:checked + .elevation-toggle-slider::after {
    left: 26px;
    background: #ff4444;
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.5);
}

.elevation-toggle-checkbox:checked ~ .toggle-text-plus {
    color: #00ff66;
    opacity: 0.3;
}

.elevation-toggle-checkbox:checked ~ .toggle-text-minus {
    color: #ff4444;
    opacity: 1;
}

select {
    width: 100%;
    padding: 12px;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid #00ff41;
    color: #00ff41;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    border-radius: 5px;
    outline: none;
    transition: all 0.3s;
    cursor: pointer;
}

select:focus {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

select option {
    background: #1a1a2e;
    color: #00ff41;
}

.flag-select-wrapper {
    display: flex;
    align-items: center;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid #00ff41;
    border-radius: 5px;
    padding: 8px 12px;
}

#flag-display {
    flex-shrink: 0;
}

.flag-select-wrapper select {
    flex: 1;
    background: transparent;
    border: none;
    padding: 4px;
    outline: none;
}

.flag-select-wrapper select:focus {
    background: transparent;
    box-shadow: none;
}

.calculate-btn {
    width: 100%;
    padding: 15px;
    background: rgba(0, 255, 65, 0.1);
    border: 2px solid #00ff41;
    color: #00ff41;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 10px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.calculate-btn:hover:not(:disabled) {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
    transform: scale(1.02);
}

.calculate-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.calculate-btn:disabled {
    cursor: not-allowed;
}

.result-group {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 255, 65, 0.05);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 5px;
}

.result-label {
    color: rgba(0, 255, 65, 0.7);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.result-value {
    color: #00ff41;
    font-size: 32px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.reference-table {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(0, 255, 65, 0.3);
}

.reference-title {
    color: #00ff41;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    opacity: 0.7;
}

.reference-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 12px;
}

.reference-item {
    color: rgba(0, 255, 65, 0.6);
    padding: 5px 0;
}

.reference-item span {
    color: #00ff41;
    font-weight: bold;
}

.info-box {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 255, 65, 0.05);
    border-left: 3px solid #00ff41;
    color: rgba(0, 255, 65, 0.8);
    font-size: 12px;
    line-height: 1.5;
}

.history-container {
    background: #2a2a2a;
    border: 2px solid #00ff41;
    border-radius: 10px;
    padding: 20px;
    width: 350px;
    height: fit-content;
    max-height: 600px;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 255, 65, 0.3);
}

.history-header h2 {
    color: #00ff41;
    font-size: 16px;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
    letter-spacing: 1px;
}

.clear-btn {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid #ff4444;
    color: #ff4444;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s;
}

.clear-btn:hover {
    background: rgba(255, 68, 68, 0.2);
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
}

.history-list {
    overflow-y: auto;
    max-height: 520px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-entry {
    background: rgba(0, 255, 65, 0.05);
    border-left: 3px solid #00ff41;
    padding: 10px;
    border-radius: 3px;
    font-size: 11px;
    color: rgba(0, 255, 65, 0.8);
}

.history-entry-country {
    color: #00ff41;
    font-weight: bold;
    margin-bottom: 5px;
}

.history-entry-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 5px;
}

.history-entry-detail {
    color: rgba(0, 255, 65, 0.7);
}

.history-entry-detail span {
    color: #00ff41;
    font-weight: bold;
}

.history-entry-result {
    border-top: 1px solid rgba(0, 255, 65, 0.2);
    padding-top: 5px;
    color: #00ff41;
    font-weight: bold;
    font-size: 12px;
}

/* Scrollbar styling */
.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(0, 255, 65, 0.05);
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #00ff41;
    border-radius: 10px;
    opacity: 0.5;
}

.history-list::-webkit-scrollbar-thumb:hover {
    opacity: 0.8;
}

/* Responsive design */
@media (max-width: 1024px) {
    .main-wrapper {
        flex-direction: column;
        align-items: center;
    }

    .history-container {
        width: 100%;
        max-width: 500px;
    }
}
