/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #25282c;
    color: #e0e0e0;
    line-height: 1.6;
}

/* Header */
header {
    background-color: #1a1d20;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}

header h1 {
    font-size: 1.5rem;
    color: #1890ff;
    flex-grow: 1;
    text-align: center;
}

header h1 a {
    color: #1890ff;
    text-decoration: none;
    transition: color 0.2s;
}

header h1 a:hover {
    color: #40a9ff;
}

header h1 .breadcrumb-separator {
    margin: 0 0.5rem;
    color: #5a5a5a;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Hamburger Button */
.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 30px;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #b6b6b6;
    transition: all 0.3s;
}

.hamburger-btn:hover span {
    background-color: #1890ff;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: -300px;
    top: 0;
    width: 300px;
    height: 100%;
    background-color: #1a1d20;
    transition: left 0.3s;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #35393e;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    color: #1890ff;
}

.review-types-list {
    list-style: none;
    padding: 0;
}

.review-types-list li {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #35393e;
}

.review-types-list li:hover {
    background-color: #35393e;
}

.review-types-list li.active {
    background-color: #1890ff;
    color: white;
}

/* Folder styles */
.folder-header {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: bold;
    background-color: #2a2d31;
    border-bottom: 1px solid #35393e;
}

.folder-header:hover {
    background-color: #35393e;
}

.folder-icon {
    display: inline-block;
    width: 1em;
    transition: transform 0.2s;
}

.folder-items {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #1f2226;
}

.folder-items li {
    padding: 0.75rem 1rem 0.75rem 2rem;
    border-bottom: 1px solid #35393e;
}

.sidebar-btn {
    margin: 1rem;
    width: calc(100% - 2rem);
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 999;
}

.overlay.active {
    display: block;
}

/* Main Content */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Summary Statistics */
.summary-stats {
    background-color: #4a2d4d;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #1890ff;
}

.stat-label {
    font-size: 0.9rem;
    color: #b6b6b6;
    margin-top: 0.25rem;
}

/* View Controls */
.view-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.view-btn {
    flex: 1;
    min-width: 120px;
}

.view-btn.active {
    background-color: #1890ff;
    color: white;
}

/* Filter and Sort Controls */
.filter-sort-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.search-input,
.sort-select,
.filter-select,
.tag-filter {
    background-color: #1a1d20;
    color: #e0e0e0;
    border: 1px solid #35393e;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

.tag-filter {
    min-width: 150px;
    max-width: 250px;
}

.tag-filter:focus {
    height: auto;
    min-height: 150px;
}

.search-input:focus,
.sort-select:focus,
.filter-select:focus,
.tag-filter:focus {
    outline: 2px solid #5b9bd5;
    outline-offset: 2px;
}

/* List View */
.list-view {
    overflow-x: auto;
}

.reviews-list {
    background-color: #1a1d20;
    border-radius: 8px;
    overflow: hidden;
}

.reviews-table {
    width: 100%;
    border-collapse: collapse;
}

.reviews-table thead {
    background-color: #1890ff;
    color: white;
}

.reviews-table th,
.reviews-table td {
    padding: 1rem;
    text-align: left;
}

.reviews-table th {
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.reviews-table th:hover {
    background-color: #2b7fd4;
}

.reviews-table th:last-child {
    cursor: default;
}

.reviews-table th:last-child:hover {
    background-color: #1890ff;
}

.reviews-table tbody tr {
    border-bottom: 1px solid #35393e;
    cursor: pointer;
    transition: background-color 0.2s;
}

.reviews-table tbody tr:nth-child(even) {
    background-color: #2f3338;
}

.reviews-table tbody tr:nth-child(odd) {
    background-color: #2a2d31;
}

.reviews-table tbody tr:hover {
    background-color: #35393e;
}

.review-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.status-reviewed {
    background-color: #2d5016;
    color: #7cb342;
}

.status-unreviewed {
    background-color: #3e3e3e;
    color: #b6b6b6;
}

.rating-stars {
    color: #ffd700;
}

.tags-cell {
    max-width: 200px;
}

.tags-cell .tag {
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
}

.links-cell {
    font-size: 1.2rem;
    white-space: nowrap;
}

.links-cell a {
    margin: 0 0.25rem;
}

.review-link {
    color: #1890ff;
    text-decoration: none;
    margin-left: 0.5rem;
    display: inline-block;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.review-link:hover {
    background-color: #1890ff;
    text-decoration: none;
}

.empty-message {
    padding: 3rem;
    text-align: center;
    color: #b6b6b6;
}

/* Map View */
.map-view {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 300px);
    min-height: 500px;
}

.map-view.hidden {
    display: none;
}

.map-controls {
    background-color: #1a1d20;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.map-controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-input {
    width: 60px;
    background-color: #25282c;
    color: #e0e0e0;
    border: 1px solid #35393e;
    padding: 0.25rem;
    border-radius: 4px;
}

#map {
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
}

/* Buttons */
.btn {
    background-color: #b6b6b6;
    color: #1a1d20;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

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

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

.btn:disabled:hover {
    opacity: 0.5;
    transform: none;
}

.primary-btn {
    background-color: #1890ff;
    color: white;
}

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

.close-btn {
    background: none;
    border: none;
    color: #b6b6b6;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 2rem;
    height: 2rem;
}

.close-btn:hover {
    color: #1890ff;
}

.btn-icon {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.btn-icon:hover {
    background-color: #1890ff;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background-color: #1a1d20;
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #35393e;
}

.modal-header h2 {
    color: #1890ff;
    font-size: 1.5rem;
}

/* Form */
form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background-color: #1a1d20;
    color: #e0e0e0;
    border: 1px solid #35393e;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: 2px solid #5b9bd5;
    outline-offset: 2px;
}

.form-group small {
    display: block;
    color: #888;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    font-style: italic;
}

/* Star Rating */
.star-rating {
    display: flex;
    gap: 0.25rem;
    font-size: 2rem;
    cursor: pointer;
    user-select: none;
}

.star {
    color: #5a5a5a;
    transition: color 0.2s, transform 0.1s;
    cursor: pointer;
}

.star:hover {
    transform: scale(1.1);
}

.star.filled {
    color: #ffd700;
}

.star.hover {
    color: #ffed4e;
}

.geolocation-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.error-message {
    color: #d32f2f;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: block;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1.5rem;
    border-top: 1px solid #35393e;
}

/* Detail Content */
.detail-content {
    padding: 1.5rem;
}

.detail-row {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #35393e;
}

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

.detail-label {
    color: #b6b6b6;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.detail-value {
    color: #e0e0e0;
    font-size: 1rem;
}

.detail-value a {
    color: #1890ff;
    text-decoration: none;
}

.detail-value a:hover {
    text-decoration: underline;
}

/* Rating group styling */
.rating-group .detail-value {
    background-color: #2a2d31;
    padding: 1rem;
    border-radius: 4px;
    border-left: 3px solid #1890ff;
}

.rating-group .rating-stars {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: #ffd700;
}

.rating-group .rating-tags {
    margin-bottom: 0.75rem;
}

.rating-group .rating-comments {
    background-color: #25282c;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    white-space: pre-wrap;
    line-height: 1.5;
}

.rating-group .rating-date {
    color: #b6b6b6;
    font-size: 0.9rem;
    font-style: italic;
}

.history-item {
    background-color: #25282c;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.history-content {
    flex: 1;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.history-date {
    color: #b6b6b6;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Manage Types */
.add-type-inputs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.add-type-inputs input {
    flex: 1;
}

.add-type-inputs select {
    min-width: 150px;
}

/* Tabs */
.manage-tabs {
    display: flex;
    border-bottom: 2px solid #35393e;
    margin-bottom: 1.5rem;
}

.tab-btn {
    background: none;
    border: none;
    color: #b6b6b6;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #1890ff;
    background-color: rgba(24, 144, 255, 0.1);
}

.tab-btn.active {
    color: #1890ff;
    border-bottom-color: #1890ff;
    font-weight: 600;
}

.tab-content {
    display: none;
}

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

.modal-large {
    max-width: 800px;
}

.existing-types-list {
    margin-top: 1.5rem;
}

.type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: #25282c;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.type-item-name {
    font-weight: 500;
    flex: 1;
}

.type-item-folder {
    color: #1890ff;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    background-color: rgba(24, 144, 255, 0.1);
    border-radius: 3px;
}

.type-item-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Folder management */
.add-folder-inputs {
    display: flex;
    gap: 0.5rem;
}

.add-folder-inputs input {
    flex: 1;
}

.existing-folders-list {
    margin-top: 1.5rem;
}

.folder-item {
    background-color: #25282c;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    padding: 0.75rem;
}

.folder-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.folder-item-name {
    font-weight: 600;
    color: #1890ff;
    font-size: 1.1rem;
}

.folder-item-actions {
    display: flex;
    gap: 0.5rem;
}

.folder-item-types {
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 2px solid #35393e;
}

.folder-type-item {
    padding: 0.5rem;
    background-color: #1f2226;
    border-radius: 3px;
    margin-bottom: 0.25rem;
    color: #e0e0e0;
    font-size: 0.9rem;
}

/* Commit Summary */
.commit-summary {
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.change-summary-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #2a2d31;
    border-radius: 4px;
    justify-content: center;
}

.stat-item {
    text-align: center;
    color: #e0e0e0;
}

.stat-item strong {
    display: block;
    font-size: 1.5rem;
    color: #1890ff;
    margin-bottom: 0.25rem;
}

.change-group {
    margin-bottom: 1.5rem;
}

.change-group h3 {
    color: #1890ff;
    margin-bottom: 0.5rem;
}

.change-item {
    background-color: #25282c;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-family: monospace;
    font-size: 0.9rem;
}

.change-added {
    border-left: 3px solid #7cb342;
}

.change-modified {
    border-left: 3px solid #ffa726;
}

.change-deleted {
    border-left: 3px solid #d32f2f;
}

.json-copy-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #25282c;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.json-copy-item span {
    font-family: monospace;
    font-size: 0.9rem;
}

/* Tags */
.tag {
    display: inline-block;
    background-color: #4a2d4d;
    color: #e0e0e0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.clickable-tag {
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.clickable-tag:hover {
    background-color: #5e3d61;
    transform: scale(1.05);
}

.clickable-tag:active {
    transform: scale(0.98);
}

/* Checkbox Labels */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #e0e0e0;
    cursor: pointer;
    margin: 0.5rem 0;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.add-type-inputs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.type-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background-color: #1a1d20;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.2rem;
    }

    .header-actions {
        flex-direction: column;
        gap: 0.25rem;
    }

    .summary-stats {
        grid-template-columns: 1fr;
    }

    .view-controls {
        flex-direction: column;
    }

    .filter-sort-controls {
        flex-direction: column;
    }

    .reviews-table {
        font-size: 0.85rem;
    }

    .reviews-table th,
    .reviews-table td {
        padding: 0.5rem;
    }

    .modal-content {
        max-width: 100%;
    }

    .geolocation-inputs {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}
