:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --light-color: #ecf0f1;
    --text-color: #333;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    --card-shadow: 0 2px 8px rgba(0,0,0,0.05);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: var(--text-color);
    line-height: 1.6;
    position: relative;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
}

.header-content {
    text-align: center;
}

h1 {
    margin: 0;
    font-size: 28px;
}

.subtitle {
    margin: 5px 0 0;
    font-size: 16px;
    opacity: 0.8;
}

.search-container {
    background-color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
}

.search-group {
    margin-bottom: 15px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-color);
}

.search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 14px;
    box-sizing: border-box;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.range-input {
    display: flex;
    align-items: center;
}

.range-input span {
    margin: 0 10px;
}

.range-input input {
    flex: 1;
}

button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.search-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.toggle-advanced {
    width: 100%;
    margin-top: 10px;
    background-color: var(--light-color);
    color: var(--primary-color);
    font-weight: 600;
}

.toggle-advanced:hover {
    background-color: #bdc3c7;
}

.advanced-search-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.advanced-search-container.collapsed {
    max-height: 0 !important;
}

.search-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.search-row .search-group {
    flex: 1;
    margin-bottom: 0;
}

.search-input-container {
    position: relative;
}

.search-tooltip {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
    cursor: help;
}

.tooltip-text {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 5px;
    border-radius: 6px;
    z-index: 1;
    font-size: 12px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s;
    margin-left: -100px;
}

.hardness-info {
    color: #7f8c8d;
    cursor: help;
}

.hardness-scale-tooltip {
    display: none;
    position: absolute;
    background-color: white;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    z-index: 100;
    width: 200px;
}

.scale-item {
    margin: 5px 0;
    font-size: 13px;
}

.scale-value {
    display: inline-block;
    width: 20px;
    font-weight: bold;
}

.color-picker-container {
    position: relative;
}

.color-picker-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: pointer;
    background: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet);
}

#colorPickerPopup, #streakColorPickerPopup {
    display: none;
    position: absolute;
    background-color: white;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    z-index: 100;
}

.content {
    display: flex;
    gap: 20px;
}

.minerals-list-container {
    flex: 1;
    max-width: 350px;
}

.minerals-list {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    max-height: 700px;
    overflow-y: auto;
}

.mineral-details {
    flex: 2;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    min-height: 700px;
}

.results-count {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.mineral-item {
    display: flex;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mineral-item:hover {
    background-color: #f9f9f9;
}

.mineral-item.active {
    background-color: #e3f2fd;
    border-left: 3px solid var(--accent-color);
}

.mineral-image-list {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-right: 10px;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #7f8c8d;
}

.mineral-info {
    flex: 1;
}

.mineral-name-list {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.mineral-props-preview {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #7f8c8d;
}

.mineral-prop {
    display: flex;
    align-items: center;
    gap: 3px;
}

.message {
    padding: 20px;
    text-align: center;
    color: #7f8c8d;
}

.loading-container {
    padding: 20px;
    text-align: center;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #7f8c8d;
    font-size: 14px;
}

.mineral-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.mineral-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.mineral-name {
    margin: 0;
    font-size: 28px;
    color: var(--primary-color);
}

.mineral-category {
    background-color: #e3f2fd;
    color: #1976d2;
    padding: 3px 8px;
    border-radius: var(--border-radius);
    font-size: 12px;
    font-weight: 600;
}

.mineral-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #7f8c8d;
}

.mineral-meta div {
    display: flex;
    align-items: center;
    gap: 5px;
}

.mineral-image-container {
    margin: 0 auto 20px;
    max-width: 100%;
    cursor: pointer;
    text-align: center;
}

.mineral-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.3s;
}

.mineral-image:hover {
    transform: scale(1.02);
}

.description-section {
    margin-bottom: 20px;
}

.property-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.property-value {
    margin-bottom: 15px;
    line-height: 1.5;
}

.description-text {
    white-space: pre-line;
}

.property-group {
    margin-bottom: 20px;
}

.property-group h3 {
    margin: 0 0 10px;
    font-size: 18px;
    color: var(--primary-color);
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.property {
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: var(--border-radius);
    border-left: 3px solid var(--accent-color);
}

.highlight {
    background-color: #fffacd;
    padding: 0 2px;
    border-radius: 3px;
}

.gallery-section {
    margin-top: 30px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.gallery-item {
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s;
}

.gallery-image:hover {
    transform: scale(1.05);
}

.gallery-image-name {
    font-size: 12px;
    margin-top: 5px;
    color: #7f8c8d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.source-section {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.source-section a {
    color: var(--accent-color);
    text-decoration: none;
}

.source-section a:hover {
    text-decoration: underline;
}

.update-info {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}

.modal-image {
    max-width: 100%;
    max-height: 80vh;
    transition: transform 0.3s;
}

.modal-content .image-info {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
}

.modal-content .image-info p {
    margin: 5px 0;
    text-align: center;
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #ccc;
}

.image-zoom-controls {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background-color: rgba(0,0,0,0.7);
    color: white;
    border: none;
    cursor: pointer;
}

.zoom-btn:hover {
    background-color: rgba(0,0,0,0.9);
}

.back-to-top-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 18px;
    box-shadow: var(--box-shadow);
    background-color: var(--accent-color);
    color: white;
    border: none;
}

.back-to-top-btn:hover {
    background-color: var(--primary-color);
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.loading-content {
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.progress-container {
    width: 100%;
    background-color: #f1f1f1;
    border-radius: var(--border-radius);
    margin: 15px 0;
    position: relative;
}

.progress-bar {
    height: 20px;
    background-color: var(--accent-color);
    border-radius: var(--border-radius);
    width: 0;
    transition: width 0.3s;
}

.progress-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    text-align: center;
    line-height: 20px;
    color: #333;
    font-size: 12px;
	
}

@media (max-width: 1200px) {
    .search-row {
        flex-wrap: wrap;
    }
    
    .search-row .search-group {
        flex: 1 1 45%;
    }
}

@media (max-width: 992px) {
    .content {
        flex-direction: column;
    }
    
    .minerals-list-container {
        max-width: 100%;
    }
    
    .minerals-list {
        max-height: 400px;
    }
}

@media (max-width: 767px) {
    .search-row {
        flex-direction: column;
    }
    
    .search-row .search-group {
        flex: 1 1 100%;
    }
    
    .minerals-list {
        max-height: 300px;
    }
    
    .global-search-actions {
        display: flex;
        gap: 10px;
    }
}



/* меню */
.mineral-nav {
    background-color: var(--primary-color);
    padding: 10px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
}

.mineral-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 0;
    padding: 0;
}

.mineral-nav li {
    position: relative;
}

.mineral-nav a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.mineral-nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.mineral-nav .fa {
    font-size: 16px;
}

.mineral-nav .badge {
    background-color: #27ae60;
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    margin-left: 5px;
}

/* Адаптация для мобильных */
@media (max-width: 767px) {
    .mineral-nav ul {
        flex-direction: column;
        gap: 5px;
    }
}

/* Мобильное меню */
.mineral-nav-toggle {
    display: none;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    cursor: pointer;
    justify-content: space-between;
    align-items: center;
}

.mineral-nav-toggle i {
    font-size: 20px;
}

@media (max-width: 767px) {
    .mineral-nav-toggle {
        display: flex;
    }
    
    .mineral-nav ul {
        display: none;
        flex-direction: column;
        gap: 5px;
        padding: 10px 0;
    }
    
    .mineral-nav ul.active {
        display: flex;
    }
    
    .mineral-nav li {
        width: 100%;
    }
    
    .mineral-nav ul ul {
        position: static;
        display: none;
        padding-left: 20px;
    }
}


/* Исправление для иконок Windows */
.mineral-nav .fab.fa-windows {
    font-size: 16px;
}

.mineral-nav .fab.fa-gem {
    font-size: 16px;
}

.mineral-nav a i.fab {
    margin-right: 5px;
    width: 16px;
    text-align: center;
}

.mineral-nav a i.fa-caret-down,
.mineral-nav a i.fa-caret-up {
    margin-left: 5px;
}

/* Исправление для подменю */
.mineral-nav ul ul {
    display: none;
    position: absolute;
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 10px;
    min-width: 200px;
    z-index: 100;
    box-shadow: var(--box-shadow);
}

.mineral-nav ul ul li {
    width: 100%;
}

.mineral-nav ul ul a {
    padding: 8px 12px;
}

/* Мобильная адаптация подменю */
@media (max-width: 767px) {
    .mineral-nav ul ul {
        position: static;
        background-color: rgba(0,0,0,0.1);
        box-shadow: none;
    }
}




/* Alphabet navigation */
.alphabet-nav {
    background-color: white;
    padding: 10px;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    box-shadow: var(--box-shadow);
    overflow-x: auto;
}

.alphabet-container {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.alphabet-letter {
    padding: 5px 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.alphabet-letter:hover {
    background-color: #e0e0e0;
}

.alphabet-letter.active {
    background-color: var(--accent-color);
    color: white;
}

/* Simple list view */
.mineral-simple-list {
    display: none;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    max-height: 700px;
    overflow-y: auto;
    padding: 10px;
}

.mineral-simple-item {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mineral-simple-item:hover {
    background-color: #f9f9f9;
}

.mineral-simple-item.active {
    background-color: #e3f2fd;
    border-left: 3px solid var(--accent-color);
}

@media (max-width: 992px) {
    .mineral-simple-list {
        max-height: 400px;
    }
}

@media (max-width: 767px) {
    .mineral-simple-list {
        max-height: 300px;
    }
}