/* ============================================
   MyCryptoATM - Main Stylesheet
   ============================================ */

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2236;
    --bg-card-hover: #1f2a42;
    --bg-input: #0d1321;
    --border: #2a3654;
    --border-accent: #f7931a;
    --text-primary: #e8ecf4;
    --text-secondary: #8892a8;
    --text-muted: #5a6478;
    --accent-btc: #f7931a;
    --accent-btc-dim: rgba(247, 147, 26, 0.15);
    --accent-green: #22c55e;
    --accent-green-dim: rgba(34, 197, 94, 0.12);
    --accent-red: #ef4444;
    --accent-red-dim: rgba(239, 68, 68, 0.12);
    --accent-blue: #3b82f6;
    --accent-blue-dim: rgba(59, 130, 246, 0.12);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --radius: 10px;
    --radius-sm: 6px;
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* === HEADER === */
.header {
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 18px;
    color: var(--accent-btc);
    letter-spacing: -0.5px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-btc);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--bg-primary);
}

.header-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.header-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}

.header-links a:hover { color: var(--text-primary); }

.submit-atm-btn {
    background: var(--accent-btc-dim);
    color: var(--accent-btc) !important;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(247, 147, 26, 0.3);
    font-weight: 600 !important;
    transition: all 0.2s;
}

.submit-atm-btn:hover {
    background: rgba(247, 147, 26, 0.25) !important;
}

/* === MAIN LAYOUT === */
.main {
    display: grid;
    grid-template-columns: 400px 1fr;
    grid-template-rows: 1fr 1fr;
    height: calc(100vh - 56px);
}

/* === TOP LEFT - SEARCH & RESULTS === */
.search-panel {
    grid-column: 1;
    grid-row: 1;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.search-box {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.search-input-wrap {
    position: relative;
}

.search-input-wrap svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

#address-input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#address-input::placeholder { color: var(--text-muted); }
#address-input:focus { border-color: var(--accent-btc); }

/* Google Places Autocomplete dropdown styling */
.pac-container {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow) !important;
    font-family: 'DM Sans', sans-serif !important;
    margin-top: 4px;
}

.pac-item {
    border-top: 1px solid var(--border) !important;
    padding: 8px 12px !important;
    color: var(--text-primary) !important;
    font-size: 13px !important;
    cursor: pointer;
}

.pac-item:hover {
    background: var(--bg-card-hover) !important;
}

.pac-item-query {
    color: var(--text-primary) !important;
    font-weight: 600 !important;
}

.pac-matched { color: var(--accent-btc) !important; }

.pac-icon { display: none !important; }

.search-info {
    padding: 10px 16px;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-info .radius-badge {
    background: var(--accent-btc-dim);
    color: var(--accent-btc);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

/* === ATM RESULTS LIST === */
.results-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.results-list::-webkit-scrollbar { width: 6px; }
.results-list::-webkit-scrollbar-track { background: transparent; }
.results-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.results-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 32px;
}

.results-placeholder svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.results-placeholder h3 {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.results-placeholder p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Ad slots */
.ad-slot-results {
    background: linear-gradient(135deg, rgba(247, 147, 26, 0.06), rgba(247, 147, 26, 0.02));
    border: 1px dashed rgba(247, 147, 26, 0.2);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 6px;
    display: none;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.ad-slot-results:hover {
    background: linear-gradient(135deg, rgba(247, 147, 26, 0.1), rgba(247, 147, 26, 0.04));
}

.ad-slot-results.visible { display: flex; }

.ad-badge {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
}

.ad-slot-results .ad-content { flex: 1; }
.ad-slot-results .ad-title { font-size: 13px; font-weight: 600; color: var(--accent-btc); }
.ad-slot-results .ad-desc { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* ATM Result Card */
.atm-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.atm-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(247, 147, 26, 0.3);
}

.atm-card.selected {
    border-color: var(--accent-btc);
    background: var(--bg-card-hover);
    box-shadow: 0 0 0 1px var(--accent-btc), 0 4px 16px rgba(247, 147, 26, 0.1);
}

.atm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.atm-card-name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.atm-card-distance { font-size: 12px; color: var(--accent-btc); font-weight: 600; white-space: nowrap; margin-left: 12px; }
.atm-card-address { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.atm-card-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-buy { background: var(--accent-green-dim); color: var(--accent-green); }
.tag-sell { background: var(--accent-blue-dim); color: var(--accent-blue); }
.tag-crypto { background: rgba(255, 255, 255, 0.06); color: var(--text-secondary); }

/* === TOP RIGHT - MAP === */
.map-panel {
    grid-column: 2;
    grid-row: 1;
    border-bottom: 1px solid var(--border);
    position: relative;
}

#map { width: 100%; height: 100%; }

/* === BOTTOM LEFT - ATM DETAILS === */
.details-panel {
    grid-column: 1;
    grid-row: 2;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 20px;
}

.details-panel::-webkit-scrollbar { width: 6px; }
.details-panel::-webkit-scrollbar-track { background: transparent; }
.details-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.details-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.details-placeholder svg { width: 40px; height: 40px; color: var(--text-muted); margin-bottom: 12px; opacity: 0.4; }
.details-placeholder p { font-size: 13px; color: var(--text-muted); }

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.detail-name { font-size: 18px; font-weight: 700; font-family: 'Space Mono', monospace; }
.detail-operator { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.detail-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-status.open { background: var(--accent-green-dim); color: var(--accent-green); }
.detail-status.closed { background: var(--accent-red-dim); color: var(--accent-red); }

.detail-section { margin-bottom: 16px; }

.detail-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.detail-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.detail-item-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.detail-item-value { font-size: 14px; font-weight: 600; }

.detail-cryptos { display: flex; gap: 6px; flex-wrap: wrap; }

.crypto-badge {
    background: var(--accent-btc-dim);
    color: var(--accent-btc);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    font-family: 'Space Mono', monospace;
}

.detail-address-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.detail-address-text { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }

.directions-btn {
    background: var(--accent-btc);
    color: var(--bg-primary);
    border: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: 'DM Sans', sans-serif;
    transition: opacity 0.2s;
}

.directions-btn:hover { opacity: 0.85; }
.directions-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.flag-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.2s;
    margin-top: 12px;
}

.flag-btn:hover { border-color: var(--accent-red); color: var(--accent-red); }

/* === BOTTOM RIGHT - COMMUNITY === */
.community-panel {
    grid-column: 2;
    grid-row: 2;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.community-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.community-header h3 { font-size: 14px; font-weight: 700; font-family: 'Space Mono', monospace; }
.community-count { font-size: 12px; color: var(--text-muted); }

.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.comments-list::-webkit-scrollbar { width: 6px; }
.comments-list::-webkit-scrollbar-track { background: transparent; }
.comments-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.community-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.community-placeholder svg { width: 40px; height: 40px; color: var(--text-muted); margin-bottom: 12px; opacity: 0.4; }
.community-placeholder p { font-size: 13px; color: var(--text-muted); }

.comment {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
}

.comment-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.comment-user { font-weight: 600; font-size: 13px; color: var(--accent-btc); }
.comment-date { font-size: 11px; color: var(--text-muted); }
.comment-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* Comment Form */
.comment-form {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.comment-form-row { display: flex; gap: 10px; margin-bottom: 10px; }

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--accent-btc); }

.comment-form input::placeholder,
.comment-form textarea::placeholder { color: var(--text-muted); }

.comment-form textarea { resize: vertical; min-height: 60px; max-height: 120px; }

.comment-form-bottom { display: flex; justify-content: space-between; align-items: center; }

.captcha { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.captcha input { width: 50px; text-align: center; padding: 6px; }

.submit-comment-btn {
    background: var(--accent-btc);
    color: var(--bg-primary);
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: opacity 0.2s;
}

.submit-comment-btn:hover { opacity: 0.85; }
.submit-comment-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.hp-field { position: absolute; left: -9999px; opacity: 0; }

/* === MODALS === */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    width: 420px;
    max-width: 90vw;
    box-shadow: var(--shadow);
}

.modal h3 { font-size: 16px; font-family: 'Space Mono', monospace; margin-bottom: 16px; }

.modal-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.modal-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
    font-size: 13px;
}

.modal-option:hover { background: var(--bg-card-hover); }
.modal-option input[type="checkbox"] { accent-color: var(--accent-btc); }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

.modal-cancel {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
}

.modal-submit {
    background: var(--accent-red);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
}

/* Submit ATM Modal */
.submit-modal .modal { width: 500px; }
.submit-modal .form-group { margin-bottom: 12px; }

.submit-modal label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submit-modal input,
.submit-modal select,
.submit-modal textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    outline: none;
}

.submit-modal select { appearance: none; cursor: pointer; }

.submit-modal .checkbox-group { display: flex; gap: 16px; flex-wrap: wrap; }

.submit-modal .checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    cursor: pointer;
}

/* === AD BANNER (map overlay) === */
.ad-banner {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 280px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    z-index: 10;
    cursor: pointer;
    transition: all 0.2s;
}

.ad-banner:hover { border-color: rgba(247, 147, 26, 0.3); }
.ad-banner .ad-badge { margin-bottom: 6px; }
.ad-banner-title { font-size: 14px; font-weight: 700; color: var(--accent-btc); font-family: 'Space Mono', monospace; margin-bottom: 4px; }
.ad-banner-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

/* === TOAST === */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--accent-green);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow);
    z-index: 2000;
    transition: transform 0.3s ease;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .main {
        grid-template-columns: 1fr;
        grid-template-rows: auto 300px auto auto;
        height: auto;
        overflow-y: auto;
    }

    body { overflow: auto; }

    .search-panel { grid-column: 1; grid-row: 1; max-height: 300px; }
    .map-panel { grid-column: 1; grid-row: 2; min-height: 300px; }
    .details-panel { grid-column: 1; grid-row: 3; min-height: 250px; }
    .community-panel { grid-column: 1; grid-row: 4; min-height: 300px; }

    .ad-banner { display: none; }
}
