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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Табове */
.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.tab-btn.active {
    background: white;
    color: #4facfe;
    border-bottom: 3px solid #4facfe;
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

/* Форми */
.shared-location {
    max-width: 600px;
    margin: 20px auto 10px;
    padding: 20px;
    background: #f0f8ff;
    border-radius: 10px;
    border: 2px solid #4facfe;
}

.shared-location label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.shared-location input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
}

.shared-location input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.rods-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.rod-column {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #dee2e6;
}

.rod-column h3 {
    margin-bottom: 15px;
    color: #4facfe;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
    font-size: 0.9em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95em;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4facfe;
}

.catch-form button[type="submit"] {
    width: 100%;
}

/* Success message */
.success-message {
    display: none;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    animation: slideDown 0.3s ease-out;
    text-align: center;
}

.success-message.show {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Autocomplete styling */
input[list] {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%236c757d" viewBox="0 0 16 16"><path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

/* Select Display Component */
.select-display {
    position: relative;
}

.select-display .select-input {
    width: 100%;
    padding: 10px 35px 10px 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%236c757d" viewBox="0 0 16 16"><path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.select-display .select-input:focus {
    outline: none;
    border-color: #4facfe;
}

.select-display .selected-text {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    min-height: 44px;
}

.select-display .text-content {
    flex: 1;
    word-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.4;
}

.select-display .clear-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.select-display .clear-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 1024px) {
    .rods-container {
        grid-template-columns: 1fr;
    }
}

/* Бутони */
.btn-primary,
button[type="submit"] {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover,
button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    cursor: pointer;
    margin-right: 10px;
    margin-bottom: 10px;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Филтри */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters select {
    flex: 1;
    min-width: 150px;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
}

#clear-filters {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#clear-filters:hover {
    background: #5a6268;
}

/* Списък с улови */
#catches-list {
    display: grid;
    gap: 15px;
}

.catch-item {
    background: #f8f9fa;
    border-left: 5px solid #4facfe;
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.catch-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.catch-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.catch-item-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #212529;
}

.catch-item-date {
    color: #6c757d;
    font-size: 0.9em;
}

.catch-item-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.catch-detail {
    font-size: 0.95em;
}

.catch-detail-label {
    font-weight: 600;
    color: #6c757d;
}

.catch-item-notes {
    margin-top: 10px;
    padding: 10px;
    background: white;
    border-radius: 5px;
    font-style: italic;
    color: #495057;
}

.catch-item-actions {
    margin-top: 10px;
    text-align: right;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-delete {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.btn-delete:hover {
    background: #c82333;
}

.btn-edit {
    background: #ffc107;
    color: #212529;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
}

.btn-edit:hover {
    background: #e0a800;
}

/* Edit Modal */
.edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.edit-modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.edit-modal-content h3 {
    margin-bottom: 20px;
    color: #495057;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
}

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

.btn-secondary:hover {
    background: #5a6268;
}

/* Управление */
.manage-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.manage-section h3 {
    margin-bottom: 15px;
    color: #495057;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-group input {
    flex: 1;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
}

.input-group button {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.input-group button:hover {
    background: #218838;
}

.manage-list {
    list-style: none;
    display: grid;
    gap: 8px;
}

.manage-list li {
    background: white;
    padding: 12px 15px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.manage-list .btn-delete {
    padding: 5px 12px;
    font-size: 0.85em;
}

/* Inline editing styles */
.item-edit-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.item-name {
    flex-grow: 1;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.item-edit-form {
    display: flex;
    flex-direction: row;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.edit-input-en, .edit-input-bg {
    flex: 1;
    min-width: 150px;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 0.95em;
}

.edit-input-en:focus, .edit-input-bg:focus {
    outline: none;
    border-color: #4facfe;
}

.edit-actions {
    display: flex;
    gap: 8px;
}

.btn-edit {
    padding: 5px 12px;
    background: #ffc107;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    transition: background 0.3s;
}

.btn-edit:hover {
    background: #e0a800;
}

.btn-save {
    padding: 6px 14px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.btn-save:hover {
    background: #218838;
}

.btn-cancel {
    padding: 6px 14px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.btn-cancel:hover {
    background: #5a6268;
}

/* Статистики */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 1em;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-number {
    font-size: 2em;
    font-weight: 700;
}

.stats-section {
    margin-bottom: 30px;
}

.stats-section h3 {
    margin-bottom: 15px;
    color: #495057;
}

/* Accordion стилове */
.accordion-section {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
}

.accordion-header {
    padding: 15px 20px;
    margin: 0;
    cursor: pointer;
    user-select: none;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.3s ease;
}

.accordion-header:hover {
    background: #e9ecef;
}

.accordion-header.active {
    background: #4facfe;
    color: white;
}

.accordion-icon {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 20px;
}

.accordion-content.active {
    max-height: 1000px;
    padding: 20px;
}

.stats-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stats-filters select {
    flex: 1;
    min-width: 150px;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
}

.stats-filters button {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.stats-filters button:hover {
    background: #5a6268;
}

.location-detail-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 5px solid #4facfe;
}

.location-detail-card h4 {
    color: #4facfe;
    font-size: 1.3em;
    margin-bottom: 15px;
}

.location-detail-card table {
    margin-top: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

thead {
    background: #4facfe;
    color: white;
}

th, td {
    padding: 12px 15px;
    text-align: left;
}

tbody tr:nth-child(even) {
    background: #f8f9fa;
}

tbody tr:hover {
    background: #e9ecef;
}

.bait-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.bait-tag {
    background: #e7f3ff;
    color: #0066cc;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.9em;
    white-space: nowrap;
}

.bait-tag-count {
    background: #0066cc;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.85em;
    margin-left: 5px;
}

/* Празен списък */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.empty-state h3 {
    margin-bottom: 10px;
}

/* Pagination */
.pagination {
    margin-top: 30px;
    text-align: center;
}

.pagination-buttons {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.pagination-buttons button {
    padding: 8px 15px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #495057;
    transition: all 0.3s;
}

.pagination-buttons button:hover {
    background: #e9ecef;
    border-color: #4facfe;
}

.pagination-buttons button.active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-color: #4facfe;
    cursor: default;
}

.pagination-buttons span {
    padding: 8px 5px;
    color: #6c757d;
}

.pagination-info {
    color: #6c757d;
    font-size: 0.9em;
}

/* Responsive */
@media (max-width: 768px) {
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1 1 50%;
    }
    
    .catch-item-header {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
