/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-card i {
    font-size: 40px;
    color: var(--primary-color);
    opacity: 0.8;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Manage Card */
.manage-card {
    padding: 30px;
}

.manage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.manage-header h2 {
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.manage-actions {
    display: flex;
    gap: 12px;
}

/* Search & Filter Box */
.search-filter-box {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    align-items: center;
    flex-wrap: wrap;
}

.search-filter-box .search-box {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.per-page-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.per-page-selector label {
    color: var(--text-secondary);
    font-size: 14px;
    white-space: nowrap;
}

.per-page-selector select {
    width: auto;
    padding: 10px 15px;
    min-width: 80px;
}

/* Search Box */
.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-box .glass-input {
    width: 100%;
    padding-left: 48px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.page-info {
    color: var(--text-secondary);
    font-size: 14px;
    min-width: 150px;
    text-align: center;
}

.pagination .glass-btn {
    padding: 10px 20px;
    min-width: 100px;
}

/* Images List */
.images-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.image-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.image-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--glass-border);
}

.image-item.selected {
    background: rgba(0, 122, 255, 0.15);
    border-color: var(--primary-color);
}

.image-checkbox {
    position: relative;
    width: 22px;
    height: 22px;
}

.image-checkbox input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--glass-border);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.image-checkbox input:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.image-checkbox input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.image-thumb {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-details {
    flex: 1;
    min-width: 0;
}

.image-name {
    font-weight: 600;
    margin-bottom: 6px;
    word-break: break-all;
}

.image-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.image-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.image-url {
    flex: 1;
    min-width: 0;
}

.image-url input {
    width: 100%;
    padding: 10px 14px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-color);
}

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

.action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn.view {
    background: rgba(0, 122, 255, 0.2);
    color: #007aff;
}

.action-btn.view:hover {
    background: rgba(0, 122, 255, 0.3);
}

.action-btn.copy {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
}

.action-btn.copy:hover {
    background: rgba(52, 199, 89, 0.3);
}

.action-btn.delete {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

.action-btn.delete:hover {
    background: rgba(255, 59, 48, 0.3);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.loading i {
    font-size: 32px;
    margin-bottom: 10px;
}

/* Delete Modal */
.delete-modal-content {
    text-align: center;
    padding: 40px;
}

.delete-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 149, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
}

.delete-icon i {
    font-size: 36px;
    color: #ff9500;
}

.delete-modal-content h3 {
    margin-bottom: 15px;
}

.delete-modal-content p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Login Modal */
.login-modal-content {
    text-align: center;
    padding: 50px 40px;
    max-width: 400px;
    margin: 0 auto;
}

.login-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(0, 122, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
}

.login-icon i {
    font-size: 48px;
    color: var(--primary-color);
}

.login-modal-content h3 {
    margin-bottom: 10px;
}

.login-modal-content > p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-form .glass-input {
    text-align: center;
    padding: 15px;
}

.login-error {
    color: #ff3b30;
    margin-top: 15px;
}

.login-error i {
    margin-right: 5px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 15px 30px;
    border-radius: 12px;
    background: rgba(30, 30, 30, 0.95);
    color: white;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid #34c759;
}

.toast.error {
    border-left: 4px solid #ff3b30;
}

/* Responsive */
@media (max-width: 900px) {
    .image-item {
        flex-wrap: wrap;
    }
    
    .image-url {
        width: 100%;
        order: 10;
        margin-top: 10px;
    }
    
    .image-actions {
        margin-left: auto;
    }
}

@media (max-width: 600px) {
    .manage-card {
        padding: 20px;
    }
    
    .manage-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .manage-actions {
        justify-content: flex-end;
    }
    
    .image-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
}
