:root {
    --primary-color: #4361ee;
    --primary-dark: #3a56d4;
    --secondary-color: #4cc9f0;
    --secondary-dark: #38b6da;
    --calculate-color: #10b981;
    --calculate-hover: #059669;
    --background-color: #f8fafc;
    --card-color: #ffffff;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --error-color: #ef4444;
    --success-color: #10b981;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --transition: all 0.25s ease;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 2rem;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

header h1 {
    color: var(--primary-color);
    font-size: 2.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 15px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

header h1 i {
    margin-right: 10px;
}

.header-description {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 1.15rem;
    max-width: 500px;
    margin-bottom: 20px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 5px;
}

#shortcuts-toggle {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

#shortcuts-toggle:hover {
    background-color: rgba(67, 97, 238, 0.08);
    transform: translateY(-2px);
}

.theme-toggle {
    background-color: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-color);
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

body.dark-mode .theme-toggle {
    border-color: #4c5667;
    color: var(--text-color);
}

body.dark-mode .theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode #shortcuts-toggle {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

body.dark-mode #shortcuts-toggle:hover {
    background-color: rgba(67, 97, 238, 0.1);
}

.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 35px;
    gap: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    background-color: var(--card-color);
    border-radius: 16px;
    padding: 10px;
}

.tab-btn {
    padding: 14px 30px;
    background-color: transparent;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
    text-align: center;
}

.tab-btn:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.35);
}

section {
    background-color: var(--card-color);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 35px;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

section h2 {
    color: var(--primary-color);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
}

section h2 i {
    margin-right: 10px;
}

.file-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.file-input {
    flex: 1 0 calc(50% - 20px);
    min-width: 250px;
    position: relative;
}

.file-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.file-input input[type="file"] {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.file-input .file-label {
    display: block;
    background-color: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.file-input .file-label:hover {
    background-color: #e2e8f0;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.file-input .file-label i {
    display: block;
    font-size: 32px;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.file-display {
    padding: 12px 16px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.95rem;
    color: #64748b;
    transition: var(--transition);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.file-display.has-file {
    background-color: rgba(76, 201, 240, 0.1);
    border-color: var(--secondary-color);
    color: var(--secondary-dark);
    font-weight: 500;
}

.calculator {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.search-type {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    grid-column: 1 / -1;
}

.search-type label {
    font-weight: 500;
    min-width: 150px;
}

.search-type select {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: white;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.input-group {
    margin-bottom: 24px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group label .tooltip {
    font-size: 14px;
    color: #999;
    cursor: help;
    position: relative;
}

.input-group label .tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: normal;
    white-space: nowrap;
    z-index: 10;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--transition);
    background-color: #f8fafc;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
    background-color: white;
}

.input-group input.error,
.input-group select.error {
    border-color: var(--error-color);
    background-color: rgba(229, 57, 53, 0.03);
}

.input-group input.valid,
.input-group select.valid {
    border-color: var(--success-color);
    background-color: rgba(67, 160, 71, 0.03);
}

.error-message {
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 5px;
    display: none;
}

.error-message.visible {
    display: block;
}

.input-with-button {
    display: flex;
    gap: 12px;
    align-items: center;
}

.input-with-button input {
    flex: 1;
    min-width: 0;
}

.btn-primary,
.btn-secondary,
.btn-calculate {
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.btn-primary::after,
.btn-secondary::after,
.btn-calculate::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.btn-primary:active::after,
.btn-secondary:active::after,
.btn-calculate:active::after {
    opacity: 0.3;
    transform: scale(80, 80) translate(-50%, -50%);
    transition: transform 0.8s, opacity 0.4s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(67, 97, 238, 0.3);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(67, 97, 238, 0.2);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: var(--text-color);
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-secondary:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.btn-calculate {
    background-color: var(--calculate-color);
    color: white;
    font-size: 1rem;
    padding: 16px 30px;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.15);
}

.btn-calculate:hover {
    background-color: var(--calculate-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.25);
}

.btn-calculate:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.15);
}

.output-section {
    margin-top: 40px;
}

.output-container {
    position: relative;
    margin-top: 20px;
}

textarea#output-result {
    width: 100%;
    height: 200px;
    padding: 16px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    resize: vertical;
    background-color: #f8fafc;
    color: var(--text-color);
    transition: var(--transition);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

textarea#output-result:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

textarea#output-result:not(:empty) {
    border-color: var(--secondary-color);
    background-color: rgba(76, 201, 240, 0.05);
}

.action-buttons {
    display: flex;
    gap: 10px;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(4px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--card-color);
    margin: 10% auto;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 80%;
    max-width: 600px;
    position: relative;
    animation: slideInDown 0.3s ease;
    transform-origin: top center;
}

@keyframes slideInDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    color: #999;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

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

#choices {
    margin: 20px 0;
    max-height: 300px;
    overflow-y: auto;
    border-radius: 8px;
}

.choice-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.choice-item:hover {
    background-color: #f5f9ff;
    border-color: var(--primary-color);
}

.choice-item input[type="radio"] {
    margin-right: 12px;
    accent-color: var(--primary-color);
    width: 18px;
    height: 18px;
}

.loader {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(30, 136, 229, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .file-input {
        flex: 1 0 100%;
    }
    
    .input-with-button {
        flex-direction: column;
    }
    
    .tabs {
        flex-direction: row;
        overflow-x: auto;
        padding: 5px;
        max-width: 100%;
    }
    
    .tab-btn {
        flex: 0 0 auto;
        font-size: 0.9rem;
        padding: 10px 15px;
    }
    
    .calculator {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-calculate {
        width: 100%;
    }
    
    section {
        padding: 15px;
    }
}

/* Dark mode improvements */
body.dark-mode {
    --background-color: #0f172a;
    --card-color: #1e293b;
    --text-color: #e2e8f0;
    --border-color: #334155;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
    --input-bg: #252525;
    --secondary-text: #aaaaaa;
    background-image: linear-gradient(to bottom, #121212, #1a1a1a);
    color-scheme: dark;
}

body.dark-mode section {
    background-color: var(--card-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid #2c2c2c;
}

body.dark-mode h2 {
    color: #4dabf5;
    border-color: #333;
}

body.dark-mode .tab-btn {
    color: #aaa;
}

body.dark-mode .tab-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .tab-btn.active {
    background-color: #1976d2;
    color: white;
    box-shadow: 0 2px 10px rgba(25, 118, 210, 0.4);
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background-color: var(--input-bg);
    border-color: #444;
    color: #e0e0e0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #777;
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
    background-color: #2d3748;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

body.dark-mode .btn-primary {
    background-color: #1976d2;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

body.dark-mode .btn-primary:hover {
    background-color: #1565c0;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.4);
}

body.dark-mode .btn-secondary {
    background-color: #2c2c2c;
    color: #bbb;
}

body.dark-mode .btn-secondary:hover {
    background-color: #3c3c3c;
    color: #eee;
}

body.dark-mode .btn-calculate {
    background-color: #00d45a;
    box-shadow: 0 2px 8px rgba(0, 212, 90, 0.3);
}

body.dark-mode .btn-calculate:hover {
    background-color: #00c853;
    box-shadow: 0 4px 12px rgba(0, 212, 90, 0.4);
}

body.dark-mode .file-input .file-label {
    background-color: #252525;
    border-color: #444;
}

body.dark-mode .file-input .file-label:hover {
    border-color: #1976d2;
    background-color: #2a2a2a;
}

body.dark-mode .file-display {
    background-color: #252525;
    color: #aaa;
    border-color: #444;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

body.dark-mode .file-display.has-file {
    background-color: rgba(0, 137, 123, 0.15);
    border-color: #00897b;
    color: #8ee2d6;
}

body.dark-mode .choice-item {
    background-color: #252525;
    border-color: #444;
}

body.dark-mode .choice-item:hover {
    background-color: #2a2a2a;
    border-color: #1976d2;
}

body.dark-mode textarea#output-result {
    background-color: #252525;
    border-color: #444;
}

body.dark-mode textarea#output-result:not(:empty) {
    background-color: rgba(30, 136, 229, 0.1);
    border-color: #1976d2;
}

/* Dark mode transitions */
body {
    transition: background-color 0.5s ease, background-image 0.5s ease, color 0.5s ease;
}

input, select, textarea, button, section, .file-label, .file-display {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* Map preview styles */
.map-preview {
    height: 0;
    overflow: hidden;
    transition: height 0.4s ease-in-out, opacity 0.3s ease;
    margin-top: 25px;
    border-radius: 16px;
    position: relative;
    opacity: 0;
}

.map-preview.show {
    height: 450px;
    border: 2px solid var(--border-color);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
    opacity: 1;
}

.map-container {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
}

.map-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f5f9;
    color: #64748b;
    font-size: 1.1rem;
    text-align: center;
    padding: 20px;
    border-radius: 14px;
    z-index: 1;
}

.waypoint-marker {
    width: 24px; 
    height: 24px;
    border-radius: 50%; 
    background-color: var(--primary-color);
    border: 3px solid white;
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.3);
}

.fix-marker {
    width: 24px; 
    height: 24px;
    border-radius: 50%; 
    background-color: var(--secondary-color);
    border: 3px solid white;
    box-shadow: 0 0 0 2px rgba(76, 201, 240, 0.3);
}

body.dark-mode .map-placeholder {
    background-color: #1e293b;
    color: #94a3b8;
}

.section-divider {
    width: 100%;
    height: 1px;
    background-color: var(--border-color);
    margin: 30px 0;
    grid-column: 1 / -1;
}

body.dark-mode .section-divider {
    background-color: #334155;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section, .calculator, .file-selection {
    animation: fadeInUp 0.5s ease-out forwards;
}

.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: white;
    color: var(--text-color);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
    max-width: 400px;
    font-weight: 500;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.success {
    border-left: 4px solid var(--success-color);
}

.notification.error {
    border-left: 4px solid var(--error-color);
}

.notification.info {
    border-left: 4px solid var(--primary-color);
}

.notification i {
    font-size: 1.5rem;
}

body.dark-mode .notification {
    background-color: #1e293b;
    color: #e2e8f0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

/* Map toggle button */
.btn-toggle-map {
    background-color: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-toggle-map i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.btn-toggle-map:hover {
    background-color: #e2e8f0;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
}

.btn-toggle-map:hover i {
    transform: rotate(15deg);
}

.btn-toggle-map.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.25);
}

body.dark-mode .btn-toggle-map {
    background-color: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

body.dark-mode .btn-toggle-map:hover {
    background-color: #475569;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

body.dark-mode .btn-toggle-map.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

body.dark-mode .btn-primary {
    background-color: var(--primary-color);
}

body.dark-mode .btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 6px 12px rgba(67, 97, 238, 0.35);
}

body.dark-mode .btn-secondary {
    background-color: #334155;
    color: #e2e8f0;
    border-color: #475569;
}

body.dark-mode .btn-secondary:hover {
    background-color: #475569;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

body.dark-mode .btn-calculate {
    background-color: var(--calculate-color);
}

body.dark-mode .btn-calculate:hover {
    background-color: var(--calculate-hover);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3);
}

/* Add styling for the action row that contains the calculate and toggle map buttons */
.action-row {
    display: flex;
    gap: 16px;
    margin-top: 30px;
    flex-wrap: wrap;
    align-items: center;
}

.action-row .btn-calculate {
    flex-grow: 1;
    margin-right: auto;
}

.action-row .btn-toggle-map {
    min-width: 120px;
}

body.dark-mode .btn-toggle-map {
    background-color: #495057;
}

body.dark-mode .btn-toggle-map:hover {
    background-color: #6c757d;
}

/* Customize Leaflet popup for dark mode */
body.dark-mode .leaflet-popup-content-wrapper {
    background-color: #333;
    color: #f5f7fa;
}

body.dark-mode .leaflet-popup-tip {
    background-color: #333;
}

/* Bookmark/favorite button */
.bookmark-btn {
    background-color: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 500;
}

.bookmark-btn:hover {
    background-color: rgba(67, 97, 238, 0.08);
    color: var(--primary-color);
}

.bookmark-btn.active {
    color: var(--primary-color);
}

/* History drawer */
.history-drawer {
    position: fixed;
    right: -300px;
    top: 0;
    width: 300px;
    height: 100vh;
    background-color: var(--card-color);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

.history-drawer.open {
    right: 0;
}

.history-toggle {
    position: fixed;
    right: 20px;
    top: 20px;
    background-color: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    border: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.history-toggle:hover {
    background-color: var(--primary-dark);
    transform: rotate(180deg);
}

.history-item {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.history-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

body.dark-mode .history-drawer {
    background-color: #1e1e1e;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .history-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Favorites panel */
.favorites-panel {
    padding: 30px;
    background-color: var(--card-color);
    border-radius: 16px;
    margin-bottom: 35px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: var(--transition);
}

.favorites-title {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.favorites-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.favorite-item {
    padding: 20px;
    background-color: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.favorite-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-color);
}

.favorite-item .remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.favorite-item:hover .remove {
    opacity: 1;
}

.favorite-item .remove:hover {
    background-color: var(--error-color);
    color: white;
}

.favorites-empty {
    padding: 30px;
    text-align: center;
    background-color: #f8fafc;
    border-radius: 12px;
    color: #64748b;
    border: 1px dashed var(--border-color);
}

body.dark-mode .favorites-empty {
    background-color: #1e293b;
    color: #94a3b8;
    border-color: #334155;
}

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 100;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Success animation */
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(10px); }
    10% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

.success-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--success-color);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
    animation: fadeInOut 2.5s ease forwards;
    z-index: 1000;
}

.success-message.show {
    display: flex;
    align-items: center;
    gap: 10px;
}

.success-message i {
    font-size: 18px;
}

/* Tooltip popup styling */
.tooltip-popup {
    position: absolute;
    background-color: #333;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: normal;
    z-index: 1000;
    white-space: normal;
    max-width: 250px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    opacity: 0.95;
    line-height: 1.4;
}

.tooltip-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Improved notification system */
.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 350px;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.notification.success {
    background-color: var(--success-color);
}

.notification.error {
    background-color: var(--error-color);
}

.notification.info {
    background-color: var(--primary-color);
}

.notification i {
    font-size: 18px;
}

/* Form validation styles */
input.valid {
    border-color: var(--success-color) !important;
    background-color: rgba(67, 160, 71, 0.03) !important;
}

input.error {
    border-color: var(--error-color) !important;
    background-color: rgba(229, 57, 53, 0.03) !important;
}

.error-message {
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 5px;
    height: 0;
    overflow: hidden;
    transition: height 0.2s ease;
}

.error-message.visible {
    height: auto;
    min-height: 18px;
}

/* Loading indicator styles */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .calculator {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .notification {
        width: 90%;
        max-width: none;
    }
    
    .tooltip-popup {
        max-width: 200px;
    }
}

/* Animation for elements */
.calculator, .file-selection, .output-section {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* File upload improvements */
.file-input .file-label {
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.file-input .file-label::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.file-input .file-label:hover::after {
    transform: translateX(100%);
}

/* Keyboard shortcuts button */
.keyboard-shortcuts {
    margin-top: 5px;
}

#shortcuts-toggle {
    background-color: #f0f4f8;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 15px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

#shortcuts-toggle:hover {
    background-color: #e4eaf3;
    transform: translateY(-2px);
}

#shortcuts-toggle:active {
    transform: translateY(0);
}

/* Shortcuts grid */
.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.shortcut-item {
    display: flex;
    flex-direction: column;
    background-color: #f5f7fa;
    border-radius: 8px;
    padding: 12px;
    transition: var(--transition);
}

.shortcut-item:hover {
    background-color: #e4eaf3;
    transform: translateY(-2px);
}

.shortcut-item .key {
    font-family: 'Roboto Mono', monospace;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 10px;
    margin-bottom: 8px;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.shortcut-item .description {
    color: #666;
    font-size: 0.9rem;
}

/* Dark mode adjustments */
body.dark-mode #shortcuts-toggle {
    background-color: #2a2a2a;
    border-color: #444;
    color: #ddd;
}

body.dark-mode .shortcut-item {
    background-color: #2a2a2a;
}

body.dark-mode .shortcut-item .key {
    background-color: #333;
    border-color: #555;
    color: #ddd;
}

body.dark-mode .shortcut-item .description {
    color: #aaa;
}

/* Focus styles for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(30, 136, 229, 0.5);
    outline-offset: 2px;
}

/* Tab focus indicator */
.tab-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.5);
}

/* Additional responsive improvements */
@media (max-width: 768px) {
    .shortcuts-grid {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
} 
