/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #1a1a2e;
    color: #eee;
    min-height: 100vh;
}

/* Login page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.login-container {
    background: #16213e;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #e94560;
}

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

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: #aaa;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #0f0f23;
    color: #fff;
    font-size: 16px;
}

.login-form input:focus {
    outline: none;
    border-color: #e94560;
}

.error-message {
    background: #ff4757;
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background: #ff6b81;
}

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

.btn-secondary:hover {
    background: #444;
}

/* Date filter */
.date-filter {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.date-filter h3 {
    color: #e94560;
    margin-bottom: 15px;
    font-size: 16px;
}

.date-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.date-inputs label {
    color: #aaa;
    font-size: 13px;
}

.date-inputs input[type="date"] {
    padding: 8px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #0f0f23;
    color: #fff;
    font-size: 14px;
    width: 100%;
}

.date-inputs input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

.date-filter .btn {
    margin-right: 8px;
    margin-top: 5px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

.login-form .btn {
    width: 100%;
}

/* Header */
header {
    background: #16213e;
    padding: 15px 30px;
    border-bottom: 1px solid #333;
}

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

.header-buttons {
    display: flex;
    gap: 10px;
}

header h1 {
    color: #e94560;
    font-size: 24px;
}

/* Main layout */
main {
    display: flex;
    max-width: 1800px;
    margin: 0 auto;
    min-height: calc(100vh - 70px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #16213e;
    padding: 20px;
    border-right: 1px solid #333;
    position: sticky;
    top: 0;
    height: calc(100vh - 70px);
    overflow-y: auto;
}

.search-box {
    margin-bottom: 25px;
}

.search-box input {
    width: 100%;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #0f0f23;
    color: #fff;
    font-size: 14px;
    margin-bottom: 10px;
}

.search-box input:focus {
    outline: none;
    border-color: #e94560;
}

.search-box .btn {
    width: 100%;
}

.tags-section h3,
.tag-management h3 {
    color: #e94560;
    margin-bottom: 15px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
}

.tag-pill {
    background: #0f0f23;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #333;
}

.tag-pill:hover {
    background: #e94560;
    border-color: #e94560;
}

.tag-pill.active {
    background: #e94560;
    border-color: #e94560;
}

.tag-pill .count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    font-size: 11px;
}

.add-tag-form {
    display: flex;
    gap: 8px;
}

.add-tag-form input {
    flex: 1;
    padding: 8px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #0f0f23;
    color: #fff;
    font-size: 14px;
}

/* Gallery */
.gallery {
    flex: 1;
    padding: 20px;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

#results-count {
    color: #aaa;
}

.active-filters {
    display: flex;
    gap: 8px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.graph-card {
    background: #16213e;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.graph-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.graph-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #0f0f23;
}

.graph-card-info {
    padding: 15px;
}

.graph-card-info h4 {
    font-size: 14px;
    color: #eee;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.graph-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.graph-card-tags .tag-mini {
    background: #0f0f23;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    color: #aaa;
}

.load-more-container {
    text-align: center;
    padding: 30px;
}

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

.modal.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}

.modal-content {
    background: #16213e;
    border-radius: 10px;
    max-width: 1200px;
    width: 100%;
    margin: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #aaa;
    z-index: 10;
}

.modal-close:hover {
    color: #e94560;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 24px;
    padding: 20px 15px;
    cursor: pointer;
    z-index: 10;
}

.modal-prev {
    left: 10px;
}

.modal-next {
    right: 10px;
}

.modal-nav:hover {
    background: #e94560;
}

#modal-image {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    background: #0f0f23;
}

.modal-details {
    padding: 20px;
}

.modal-details h3 {
    color: #e94560;
    margin-bottom: 5px;
}

.file-date {
    color: #888;
    font-size: 13px;
    margin-bottom: 15px;
}

.modal-text {
    margin-bottom: 20px;
}

.modal-text label,
.modal-tags label {
    display: block;
    color: #aaa;
    margin-bottom: 8px;
    font-size: 14px;
}

.modal-text textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #0f0f23;
    color: #fff;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 10px;
}

.modal-tags .tag-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.modal-tags .tag-pill {
    display: flex;
    align-items: center;
    gap: 5px;
}

.modal-tags .tag-pill .remove-tag {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 14px;
    padding: 0 3px;
}

.modal-tags .tag-pill .remove-tag:hover {
    color: #ff4757;
}

.add-tag-inline {
    display: flex;
    gap: 8px;
}

.add-tag-inline input {
    flex: 1;
    padding: 8px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #0f0f23;
    color: #fff;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    main {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid #333;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .modal-nav {
        padding: 10px;
    }
}
