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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.6rem 1.2rem; /* Üst barı biraz küçült */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo {
    height: 38px;
    width: auto;
    object-fit: contain;
}

header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    height: 100%;
}

/* Mobil uyumluluk */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: 50vh;
        overflow-y: auto;
    }
    
    .map-container {
        flex: 1;
        min-height: 50vh;
    }
    
    header h1 {
        font-size: 1.2rem;
    }
    
    .header-logo {
        height: 40px;
    }
}

.sidebar {
    width: 350px;
    background: white;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    overflow-y: auto;
    padding: 1.5rem;
}

.control-panel h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: #667eea;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.control-panel h3 {
    font-size: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #555;
}

.mode-selector label {
    display: block;
    margin: 0.5rem 0;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.mode-selector label:hover {
    background-color: #f0f0f0;
}

.mode-selector input[type="radio"] {
    margin-right: 0.5rem;
}

.device-selector select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.device-selector select:focus {
    outline: none;
    border-color: #667eea;
}

.antenna-form {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.form-group {
    margin-bottom: 1rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group .degree {
    position: absolute;
    right: 15px;
    top: 38px;
    color: #999;
    font-weight: bold;
}

.angle-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.angle-control input {
    flex: 1;
}

.btn-angle {
    padding: 0.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    min-width: 40px;
}

.btn-angle:hover {
    background: #5568d3;
}

.btn-angle.active {
    background: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.3);
}

.help-text {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.25rem;
    font-style: italic;
}

.elevation-display {
    padding: 0.5rem;
    background: #e7f3ff;
    border: 2px solid #17a2b8;
    border-radius: 6px;
    font-weight: bold;
    color: #17a2b8;
    text-align: center;
}

.target-marker {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn,
button.btn-primary,
button.btn-danger,
button.btn-success {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    text-align: center;
    width: 100%;
    margin-top: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

/* Küçük buton stili (tam ekran vb.) */
.btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    width: auto;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Yayın Açısı Butonları */
.transmission-angle-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.transmission-angle-btn {
    padding: 1rem 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 3px solid transparent;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 50px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.transmission-angle-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
}

.transmission-angle-btn.active {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-color: #28a745;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.3);
    transform: scale(1.05);
}

.transmission-angle-btn:active {
    transform: scale(0.98);
}

.btn.active {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.3);
}

.map-container {
    flex: 1;
    position: relative;
    min-height: 400px;
    height: 100%;
}

/* Tam ekran modu */
.map-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
}

.map-container.fullscreen #map {
    height: 100%;
    min-height: 100%;
}

.container.fullscreen-mode header,
.container.fullscreen-mode .sidebar {
    display: none;
}

.container.fullscreen-mode .main-content {
    height: 100vh;
}

#map {
    width: 100%;
    height: 100%;
    min-height: 400px;
    position: relative;
    z-index: 0;
}

.map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 280px;
    align-items: stretch;
}

.search-box {
    display: flex;
    gap: 0.5rem;
    background: white;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.search-box input {
    flex: 1;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 0;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-search {
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-search:hover {
    background: #5568d3;
}

.layer-control {
    background: white;
    padding: 0.75rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.layer-control h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: #555;
    font-weight: 600;
}

.layer-control select {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    background: white;
}

.layer-control select:focus {
    outline: none;
    border-color: #667eea;
}

.elevation-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    font-size: 0.9rem;
    text-align: center;
}

.elevation-info strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 500;
}

.elevation-info span {
    font-size: 1.3rem;
    font-weight: bold;
    display: block;
}

.antenna-list {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #eee;
}

.antenna-item {
    background: #f9f9f9;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    cursor: pointer;
    transition: all 0.2s;
}

.antenna-item:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.antenna-item.selected {
    background: #e7f3ff;
    border-left-color: #17a2b8;
}

.antenna-item h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.antenna-item .info {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.antenna-item .info span {
    display: flex;
    justify-content: space-between;
}

.connection-line {
    stroke: #667eea;
    stroke-width: 3;
    stroke-dasharray: 5, 5;
    opacity: 0.8;
    cursor: pointer;
    transition: stroke-width 0.2s;
    z-index: 400;
}

.connection-line:hover {
    stroke-width: 5;
    opacity: 1;
}

.obstacle-marker {
    z-index: 500 !important;
}

.obstacle-segment {
    z-index: 300 !important;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.fresnel-zone {
    pointer-events: none;
}

.distance-label {
    pointer-events: none;
}

.connection-info {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #eee;
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 8px;
}

.connection-detail-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.connection-detail-item:last-child {
    border-bottom: none;
}

.connection-detail-item strong {
    color: #667eea;
    display: inline-block;
    min-width: 120px;
}

/* Anten marker'ı: çizgi antenin tam merkezinden geçtiği halde,
   yüksek z-index yüzünden çizgiyi kısmen kapatıyordu.
   Z-index'i bağlantı çizgisinin (400) altına düşürdük ki
   çizgi marker'ın üstünde görünsün ve antene tam temas ediyormuş gibi dursun. */
.antenna-marker {
    cursor: pointer;
    position: relative;
    z-index: 350;
}

.antenna-marker.selected {
    filter: drop-shadow(0 0 8px #17a2b8);
}

.angle-indicator {
    stroke: #ff0000;
    stroke-width: 6;
    fill: none;
    cursor: grab;
    transition: stroke-width 0.2s;
    filter: drop-shadow(0 0 3px rgba(255, 0, 0, 0.5));
    pointer-events: stroke;
}

.angle-indicator:hover {
    stroke-width: 8;
    cursor: grab;
    filter: drop-shadow(0 0 5px rgba(255, 0, 0, 0.8));
}

.angle-indicator.dragging {
    cursor: grabbing !important;
    stroke-width: 8;
}

.angle-label {
    font-size: 12px;
    fill: #ff6b6b;
    font-weight: bold;
    pointer-events: none;
}

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

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: 40vh;
    }
    
    .map-controls {
        max-width: calc(100% - 20px);
        left: 10px;
        right: 10px;
    }
    
    .search-box {
        flex-direction: column;
    }
}
