:root {
    --color-gray-75: #bfbfbf;
    --color-gray-50: #808080;
    --color-gray-25: #404040;
    --color-white: #ffffff;
    --color-green: #4CAF50;
    --color-red: #f44336;
    --color-blue: #2196F3;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--color-gray-75);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.sidebar {
    width: 400px;
    background: var(--color-white);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.map-container {
    flex: 1;
    position: relative;
}

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

.header {
    background: var(--color-gray-25);
    color: var(--color-white);
    padding: 20px;
    text-align: center;
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.header-logo img {
    height: 60px;
    width: auto;
}

.header h1 {
    font-size: 1.5em;
    margin: 0;
}

.header p {
    font-size: 0.9em;
    opacity: 0.9;
    margin: 5px 0 0 0;
}

.controls {
    padding: 20px;
    border-bottom: 1px solid var(--color-gray-75);
}

.content-panel {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.btn {
    background: var(--color-green);
    color: var(--color-white);
    border: none;
    padding: 12px 24px;
    font-size: 1em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    width: 100%;
    font-weight: 500;
}

.btn:hover {
    background: #45a049;
    transform: translateY(-1px);
}

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

.btn-secondary {
    background: var(--color-gray-50);
}

.btn-secondary:hover {
    background: var(--color-gray-25);
}

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

.input-with-button input {
    flex: 1;
}

.input-with-button .btn {
    width: auto;
    min-width: 40px;
    padding: 8px 12px;
    margin-bottom: 0;
    font-size: 16px;
}

.status {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

.status.loading {
    background: #e3f2fd;
    color: #1976d2;
    border-left: 4px solid #2196f3;
}

.status.success {
    background: #e8f5e8;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.status.error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.stations-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.station-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid var(--color-green);
    transition: all 0.3s ease;
    cursor: pointer;
}

.station-card:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.station-card.inactive {
    border-left-color: var(--color-red);
}

.station-name {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.station-info {
    color: #666;
    font-size: 0.9em;
    line-height: 1.5;
}

.station-info strong {
    color: #333;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.stats {
    background: var(--color-gray-25);
    color: var(--color-white);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
}

.stats h3 {
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 600;
}

.stats-number {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--color-green);
}

/* Поиск по регионам */
.region-search-container input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(42, 70, 255, 0.1);
}

.region-search-container input::placeholder {
    color: #aaa;
}

#regionSearchResults::-webkit-scrollbar {
    width: 6px;
}

#regionSearchResults::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

#regionSearchResults::-webkit-scrollbar-track {
    background: #f5f5f5;
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 50vh;
        order: 2;
    }

    .map-container {
        height: 50vh;
        order: 1;
    }

    .header-logo img {
        height: 45px;
    }

    .header h1 {
        font-size: 1.2em;
    }

    .header p {
        font-size: 0.8em;
    }

    .controls {
        padding: 15px;
    }

    .content-panel {
        padding: 15px;
    }
}

/* Панель авторизации на карте */
.auth-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.auth-btn {
    background: var(--color-white);
    border: 2px solid var(--color-blue);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-blue);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.auth-btn:hover {
    background: var(--color-blue);
    color: var(--color-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.icon-user {
    font-size: 16px;
}

/* Баннер продажи метеостанций */
.station-banner {
    position: absolute;
    bottom: 20px;
    left: 55%;
    transform: translateX(-50%);
    z-index: 1000;
    background: linear-gradient(135deg, #2a46ff 0%, #1a36df 100%);
    color: var(--color-white);
    padding: 16px 28px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(42, 70, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 600px;
}

.station-banner:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 28px rgba(42, 70, 255, 0.4);
}

.station-banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.station-banner-icon {
    font-size: 32px;
}

.station-banner-text h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.station-banner-text p {
    font-size: 13px;
    opacity: 0.95;
}

.station-banner-arrow {
    font-size: 20px;
    margin-left: auto;
}

@media (max-width: 768px) {
    .station-banner {
        max-width: 90%;
        padding: 12px 20px;
    }
    
    .station-banner-text h3 {
        font-size: 14px;
    }
    
    .station-banner-text p {
        font-size: 12px;
    }
}

/* Модальное окно авторизации */
.auth-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}

.auth-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.auth-modal-header {
    background: linear-gradient(135deg, var(--color-blue) 0%, #1976D2 100%);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.auth-modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.auth-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.auth-modal-body {
    padding: 30px;
}

.auth-type-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.auth-type-btn {
    padding: 10px 6px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    font-size: 12px;
}

.auth-type-btn .auth-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.auth-type-btn .auth-title {
    font-weight: 600;
    font-size: 11px;
}

.auth-type-btn.active {
    border-color: var(--color-blue);
    background: #f3f8ff;
    color: var(--color-blue);
}

.auth-type-btn:hover {
    border-color: var(--color-blue);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-blue);
}

.auth-submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--color-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.auth-submit-btn:hover {
    background: #1976D2;
}

.test-credentials {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-top: 20px;
    font-size: 13px;
    color: #6c757d;
}

.test-credentials h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 14px;
}

.test-credentials p {
    margin: 5px 0;
}

/* Стили для checkbox */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    gap: 10px;
    margin: 0;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkmark {
    display: none;
}

@media (max-width: 768px) {
    .auth-panel {
        top: 10px;
        right: 10px;
    }

    .auth-btn {
        padding: 10px 12px;
        font-size: 13px;
    }

    .auth-modal-content {
        margin: 10% auto;
        width: 95%;
    }

    .auth-modal-body {
        padding: 20px;
    }

    .auth-type-selector {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}
