/* FreeMyMap – Stylesheet
   Aesthetic: Clean, cartographic, liberation-themed.
   Colors: OSM greens + warm freedom-accent. */

:root {
    --primary: #7EBC6F;
    --primary-dark: #5a9a4a;
    --primary-hover: #6aad59;
    --bg: #f0f4ec;
    --card-bg: #ffffff;
    --text-main: #2c3e2d;
    --text-muted: #6b7f6c;
    --border: #d4e0d4;
    --success: #3d8b37;
    --error: #c0392b;
    --accent: #e8734a;
    --link-bg: #eef6eb;
    --link-border: #7EBC6F;
    --input-focus: #7EBC6F;
    --shadow-sm: 0 1px 3px rgba(44, 62, 45, 0.08);
    --shadow-md: 0 4px 12px rgba(44, 62, 45, 0.1);
    --shadow-lg: 0 8px 30px rgba(44, 62, 45, 0.12);
    --radius: 10px;
    --radius-lg: 14px;
    --font-display: 'DM Sans', 'Avenir', 'Segoe UI', sans-serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,500;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

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

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px 16px;
    line-height: 1.6;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(126, 188, 111, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(232, 115, 74, 0.04) 0%, transparent 50%);
}

.container {
    width: 100%;
    max-width: 580px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.25rem;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
}

header {
    text-align: center;
    margin-bottom: 1.75rem;
    padding-top: 0.5rem;
}

.logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.logo-icon {
    width: 28px;
    height: 28px;
    stroke: var(--primary-dark);
}

h1 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

h1 span.accent { color: var(--primary-dark); }

p.subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 400;
    margin-top: 0.25rem;
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.tabs {
    display: flex;
    gap: 2px;
    background: var(--bg);
    border-radius: 8px;
    padding: 3px;
}

.tab-btn {
    padding: 0.45rem 0.9rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: white;
    color: var(--primary-dark);
    box-shadow: var(--shadow-sm);
}

.tab-btn:hover:not(.active) { color: var(--text-main); }

.lang-switcher {
    display: flex;
    gap: 2px;
    background: var(--bg);
    border-radius: 6px;
    padding: 3px;
}

.lang-btn {
    padding: 0.35rem 0.55rem;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lang-btn.active { background: var(--primary); color: white; }
.lang-btn:hover:not(.active) { background: var(--border); }

.tab-content { display: none; }
.tab-content.active { display: block; }

.input-group { margin-bottom: 1.25rem; }

input[type="text"] {
    width: 100%;
    padding: 13px 16px;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    background: #fafcf9;
    color: var(--text-main);
}

input[type="text"]::placeholder {
    font-family: var(--font-body);
    color: #a0b4a1;
}

input[type="text"]:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(126, 188, 111, 0.15);
    background: white;
}

button.btn-convert {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

button.btn-convert:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #4e8a3f 100%);
    box-shadow: 0 4px 14px rgba(126, 188, 111, 0.35);
    transform: translateY(-1px);
}

button.btn-convert:active { transform: translateY(0); }

button.btn-convert:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

button.btn-convert::after {
    content: ' →';
    display: inline;
    transition: transform 0.2s;
}

button.btn-convert:hover::after {
    display: inline-block;
    transform: translateX(3px);
}

.result-area {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: none;
    animation: fadeUp 0.3s ease;
}

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

.result-area.active { display: block; }

.result-item { margin-bottom: 1rem; }

.result-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.result-value {
    font-family: var(--font-mono);
    font-size: 0.92rem;
    font-weight: 500;
    word-break: break-all;
    color: var(--text-main);
}

.result-link-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.9rem 1rem;
    background: var(--link-bg);
    border: 1.5px solid var(--link-border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--primary-dark);
    font-weight: 500;
    transition: all 0.2s ease;
    margin-top: 0.3rem;
}

.result-link-box:hover {
    background: #dff0da;
    box-shadow: var(--shadow-sm);
}

.result-link-box svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
}

.result-link-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.82rem;
    font-family: var(--font-mono);
}

.copy-btn {
    flex-shrink: 0;
    padding: 0.45rem;
    background: white;
    border: 1.5px solid var(--primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: var(--link-bg);
    transform: scale(1.05);
}

.copy-btn svg {
    width: 15px;
    height: 15px;
    stroke: var(--primary-dark);
}

.toast {
    visibility: hidden;
    min-width: 260px;
    margin-left: -130px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 14px 20px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    bottom: 30px;
    font-size: 0.88rem;
    font-family: var(--font-body);
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
    box-shadow: var(--shadow-md);
}

.toast.show { visibility: visible; opacity: 1; bottom: 40px; }
.toast.error { background-color: var(--error); }
.toast.success { background-color: var(--success); }

.note {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.82rem;
    color: #92400e;
    line-height: 1.5;
}

.info-section { margin-bottom: 1.5rem; }

.info-section h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.info-section p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.url-examples {
    margin: 0.75rem 0;
    padding-left: 1.25rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 2;
}

.url-examples code {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--primary-dark);
}

.footer {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.footer a {
    color: var(--primary-dark);
    text-decoration: none;
}

.footer a:hover { text-decoration: underline; }

@media (max-width: 480px) {
    .container { padding: 1.5rem; }
    h1 { font-size: 1.35rem; }
    .nav-bar { flex-direction: column; gap: 0.75rem; align-items: stretch; }
    .nav-bar > * { justify-content: center; }
}
