/* Modern Compact Design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header */
.site-header {
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.navbar-brand {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color) !important;
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: color 0.2s;
}

.navbar-brand:hover {
    color: var(--primary-hover) !important;
}
h2 {
    font-size: 22px;
}
h3 {
    font-size: 18px;
}
.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-size: 14px;
    padding: 6px 12px !important;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    margin: 0 2px;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
    background-color: var(--bg-light);
}

.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
    background-color: rgba(37, 99, 235, 0.1);
    font-weight: 600;
}

.more-menu {
    position: relative;
}

.more-menu .dropdown-toggle::after {
    margin-left: 6px;
}

.more-menu .dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 8px 0;
    min-width: 220px;
}

.more-menu .dropdown-item {
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
}

.more-menu .dropdown-item.active,
.more-menu .dropdown-item:active {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

@media (min-width: 992px) {
    .more-menu:hover > .dropdown-menu {
        display: block;
    }
    .more-menu > .dropdown-toggle {
        cursor: default;
    }
}

/* Main Content */
.site-main {
    min-height: calc(100vh - 180px);
    padding: 24px 0;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.lead {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

/* Tabs */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
}
.centerbl {
    text-align: center;
}
.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    padding: 10px 16px;
    font-weight: 500;
    font-size: 22px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: all 0.2s;
    margin-right: 4px;
}
.cities_block ul {
        display: flex;
    padding: 0;
}
.cities_block li {
    list-style: none;
    padding-right: 10px;
}
.cities_block a {
    color: #000;
}
.cities_block a:hover {
    text-decoration: none;
}
.tab-content {
    padding-top: 50px;
    padding-bottom: 50px;
    padding-left: 10px;
    padding-right: 10px;
    background: #f8fafc;
    border-radius: 10px;
}
.nav-tabs .nav-link:hover {
    border-bottom-color: var(--border-color);
    color: var(--primary-color);
    background-color: var(--bg-light);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: transparent;
    font-weight: 600;
    font-size: 22px;
}

/* Forms */
.form-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 6px;
    text-transform: none;
    letter-spacing: 0;
}

.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 15px;
    transition: all 0.2s;
    background-color: var(--bg-white);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.form-control:hover,
.form-select:hover {
    border-color: #cbd5e1;
}

/* Валидация форм */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 3.6 .4.4.4-.4m0 4.8-.4-.4-.4.4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
}

/* Buttons */
.btn {
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-weight: 600;
    font-size: 24px;
    border: none;
    transition: all 0.2s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #1e40af 100%);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: #fff;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
}
.site-footer a {
    color: #000;
}
.btn-outline-primary {
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    background-color: transparent;
    box-shadow: none;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.btn-link {
    color: var(--primary-color);
    text-decoration: none;
    box-shadow: none;
    padding: 4px 8px;
}

.btn-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
    transform: none;
    box-shadow: none;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Photo Upload Area */
.photo-upload-area {
    border: 2px dashed var(--border-color);
    padding: 32px;
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-lg);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.search-bl {
    margin-top: 60px;
    padding-left: 50px;
}
.photo-upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.photo-upload-area:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.photo-upload-area:hover::before {
    opacity: 1;
}

.silhouette-placeholder {
    opacity: 0.4;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.silhouette-placeholder svg {
    width: 150px;
    height: 180px;
}

.uploaded-image-container {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.uploaded-image-container img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    display: block;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-color);
    padding: 48px 24px;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
    box-shadow: var(--shadow-md);
    transform: scale(1.01);
}

.drop-zone p {
    margin: 8px 0;
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
}

.drop-zone .small {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Search Results */
#searchResults {
    margin-top: 32px;
}

.result-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    transition: all 0.2s;
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
}

.result-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.result-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    margin-right: 16px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.result-info {
    flex-grow: 1;
}

.result-info h3 {
    font-size: 18px;
    margin-bottom: 4px;
    font-weight: 600;
    color: var(--text-primary);
}

.result-info p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 4px 0;
}

.result-city {
    color: var(--text-primary);
    font-weight: 500;
}

.similarity-score {
    font-weight: 600;
    color: var(--success-color);
    font-size: 14px;
}

/* Accordion */
.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    overflow: hidden;
    background-color: var(--bg-white);
}

.accordion-button {
    background-color: var(--bg-white);
    border: none;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    box-shadow: none;
    border-radius: 0;
}

.accordion-button:not(.collapsed) {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

.accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    border-color: transparent;
}

.accordion-body {
    padding: 0 20px 16px 20px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
    margin-top: 48px;
    background-color: var(--bg-light);
}

.site-footer p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Progress Bar */
.progress {
    height: 6px;
    background-color: var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--success-color) 100%);
    border-radius: var(--radius-sm);
    transition: width 0.3s;
}

/* Alert */
.alert {
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
    background-color: var(--bg-light);
    color: var(--text-primary);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
}

.alert-info {
    border-left-color: var(--primary-color);
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.05) 0%, var(--bg-light) 100%);
}

.alert-danger {
    border-left-color: #ef4444;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.05) 0%, var(--bg-light) 100%);
}

/* Container adjustments */
.container {
    padding-left: 16px;
    padding-right: 16px;
}

.my-4 {
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

.my-5 {
    margin-top: 2rem !important;
    margin-bottom: 2rem !important;
}

.mb-3 {
    margin-bottom: 0.75rem !important;
}

.mb-4 {
    margin-bottom: 1rem !important;
}

.mt-3 {
    margin-top: 0.75rem !important;
}

.mt-4 {
    margin-top: 1rem !important;
}

.mt-5 {
    margin-top: 2rem !important;
}

/* Responsive */
@media (max-width: 768px) {
    .page-title {
        font-size: 24px;
    }
    
    .lead {
        font-size: 15px;
    }
    .nav-tabs {
        display: block;
    }
    .nav-tabs button {
        width: 100%;
    }
    .nav-tabs .nav-link.active {
        font-size: 18px;
    }
        .navbar-nav {
        margin-top: 12px;
    }
    
    .photo-upload-area {
        min-height: 240px;
        padding: 24px;
    }
    
    .result-item {
        flex-direction: column;
        text-align: center;
    }
    
    .result-image {
        margin-right: 0;
        margin-bottom: 12px;
    }
    
    .site-main {
        padding: 16px 0;
    }
    
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
}

@media (max-width: 576px) {
    .page-title {
        font-size: 20px;
    }
    
    .btn-lg {
        padding: 10px 20px;
        font-size: 15px;
    }
    
    .nav-tabs .nav-link {
        padding: 8px 12px;
        font-size: 18px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Blur Effect for Search - эффект перебора фотографий */
.blur-animation {
    animation: photoBlurCycle 1.5s ease-in-out infinite;
}

@keyframes photoBlurCycle {
    0% {
        filter: blur(0px);
        opacity: 1;
    }
    25% {
        filter: blur(8px);
        opacity: 0.7;
    }
    50% {
        filter: blur(12px);
        opacity: 0.5;
    }
    75% {
        filter: blur(8px);
        opacity: 0.7;
    }
    100% {
        filter: blur(0px);
        opacity: 1;
    }
}

/* Smooth transitions */
* {
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Modal improvements */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
}

/* Grid improvements */
.row {
    margin-left: -8px;
    margin-right: -8px;
}

.row > * {
    padding-left: 8px;
    padding-right: 8px;
}

.g-3 {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
}

/* Text utilities */
.text-muted {
    color: var(--text-secondary) !important;
}

.text-center {
    text-align: center !important;
}

.text-end {
    text-align: right !important;
}

/* Flex utilities */
.flex-grow-1 {
    flex-grow: 1;
}

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-center {
    justify-content: center;
}

/* Spacing utilities */
.w-100 {
    width: 100%;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.p-0 {
    padding: 0;
}
