* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo h1 {
    color: white;
    font-size: 28px;
    font-weight: 700;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 30px;
    margin-bottom: 30px;
}


/* Control Panel */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    font-family: 'Cairo', sans-serif;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-secondary:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-1px);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Info Box */
.info-box {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    border-right: 4px solid var(--primary-color);
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.info-item .label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

.info-item .value {
    font-size: 20px;
    color: var(--primary-color);
    font-weight: 700;
    font-family: 'Courier New', monospace;
    direction: ltr;
    text-align: right;
}

.copy-icon {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    min-width: 32px;
    min-height: 32px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.copy-icon:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.copy-icon:active:not(:disabled) {
    transform: scale(0.95);
}

.copy-icon:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.copy-icon svg {
    width: 16px;
    height: 16px;
}

/* Instructions */
.instructions {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

.instructions h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 18px;
}

.instructions ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.instructions li {
    color: var(--text-secondary);
    padding-right: 24px;
    position: relative;
    line-height: 1.6;
}

.instructions li::before {
    content: "✓";
    position: absolute;
    right: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

/* Map Wrapper */
.map-wrapper {
    position: relative;
    height: calc(100vh - 240px);
    min-height: 500px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.map-hint {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 1000;
    animation: pulse 2s infinite;
}

.map-hint p {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer p {
    color: white;
    font-size: 14px;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(150px);
    background: var(--secondary-color);
    color: white;
    padding: 16px 32px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    font-weight: 600;
    z-index: 10000;
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Custom Marker Popup */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 8px;
}

.leaflet-popup-content {
    margin: 12px;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

/* Loading Spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-primary.loading svg {
    animation: spin 1s linear infinite;
}

/* Responsive Design */

/* Tablets and smaller desktops */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 350px 1fr;
        gap: 20px;
    }
    
    .container {
        max-width: 100%;
    }
}

/* Tablets */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .control-panel {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .btn-primary {
        grid-column: 1 / -1;
    }
    
    .map-wrapper {
        height: 500px;
        min-height: 500px;
    }
}

/* Mobile Landscape and small tablets */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header {
        padding: 15px 20px;
        margin-bottom: 20px;
        border-radius: 15px;
    }

    .logo h1 {
        font-size: 18px;
    }

    .logo svg {
        width: 30px;
        height: 30px;
    }
    
    .main-content {
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .control-panel {
        grid-template-columns: 1fr;
    }

    .map-wrapper {
        height: 450px;
        min-height: 450px;
        border-radius: 15px;
    }

    .btn-primary {
        font-size: 16px;
        padding: 14px 20px;
    }
    
    .btn-secondary {
        font-size: 14px;
        padding: 10px 16px;
    }
    
    .info-box {
        padding: 20px;
    }

    .info-item {
        padding: 14px;
    }

    .info-item .label {
        font-size: 13px;
    }

    .info-item .value {
        font-size: 18px;
    }
    
    .copy-icon {
        min-width: 28px;
        min-height: 28px;
        padding: 6px;
    }
    
    .copy-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .instructions {
        padding: 20px;
    }
    
    .instructions h3 {
        font-size: 16px;
    }
    
    .instructions li {
        font-size: 14px;
    }

    .map-hint {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
    }

    .map-hint p {
        font-size: 12px;
    }
    
    .footer {
        padding: 15px;
        border-radius: 12px;
    }
    
    .footer p {
        font-size: 13px;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    .header {
        padding: 12px 15px;
        margin-bottom: 15px;
        border-radius: 12px;
    }
    
    .logo {
        gap: 10px;
    }

    .logo h1 {
        font-size: 16px;
    }

    .logo svg {
        width: 25px;
        height: 25px;
    }
    
    .main-content {
        gap: 12px;
        margin-bottom: 12px;
    }

    .btn-primary {
        font-size: 15px;
        padding: 12px 16px;
        border-radius: 10px;
    }
    
    .btn-primary svg {
        width: 18px;
        height: 18px;
    }
    
    .btn-secondary {
        font-size: 13px;
        padding: 10px 14px;
        border-radius: 8px;
    }
    
    .btn-secondary svg {
        width: 14px;
        height: 14px;
    }
    
    .info-box {
        padding: 16px;
        border-radius: 12px;
        gap: 12px;
    }

    .info-item {
        padding: 12px;
        border-radius: 10px;
    }

    .info-item .label {
        font-size: 12px;
    }

    .info-item .value {
        font-size: 16px;
    }
    
    .copy-icon {
        min-width: 26px;
        min-height: 26px;
        padding: 5px;
        border-radius: 6px;
    }
    
    .copy-icon svg {
        width: 13px;
        height: 13px;
    }

    .map-wrapper {
        height: 350px;
        min-height: 350px;
        border-radius: 12px;
    }
    
    .instructions {
        padding: 16px;
        border-radius: 12px;
    }
    
    .instructions h3 {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    .instructions ul {
        gap: 10px;
    }
    
    .instructions li {
        font-size: 13px;
        padding-right: 20px;
        line-height: 1.5;
    }

    .map-hint {
        top: 8px;
        right: 8px;
        padding: 6px 10px;
        border-radius: 8px;
    }

    .map-hint p {
        font-size: 11px;
    }
    
    .footer {
        padding: 12px;
        border-radius: 10px;
    }
    
    .footer p {
        font-size: 12px;
    }
    
    .toast {
        bottom: 20px;
        padding: 12px 24px;
        font-size: 14px;
        border-radius: 10px;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .logo h1 {
        font-size: 14px;
    }
    
    .logo svg {
        width: 22px;
        height: 22px;
    }
    
    .btn-primary {
        font-size: 14px;
        padding: 11px 14px;
    }
    
    .info-item .value {
        font-size: 15px;
    }
    
    .map-wrapper {
        height: 300px;
        min-height: 300px;
    }
}

