/* ============================================
   FPT Web Push - Settings & Tag Management Styles
   ============================================ */

/* ============================================
   Settings Page
   ============================================ */
.settings-section {
    padding: 0 24px;
    margin-bottom: 32px;
}

.settings-section-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-section-title i {
    color: var(--primary-color);
    font-size: 18px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.settings-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.25s ease;
    position: relative;
}

.settings-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.settings-card-clickable {
    cursor: pointer;
}

.settings-card-clickable:hover {
    border-color: var(--accent-color);
}

.settings-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.settings-card-icon i {
    font-size: 20px;
    color: #fff;
}

.settings-card-body {
    flex: 1;
    min-width: 0;
}

.settings-card-body h3 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.settings-card-body p {
    font-size: 13px;
    color: #888;
    line-height: 1.4;
}

.settings-card-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 10px;
    background: #e6f7ff;
    color: var(--accent-color);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.settings-card-arrow {
    color: #ccc;
    font-size: 14px;
    transition: color 0.2s, transform 0.2s;
}

.settings-card:hover .settings-card-arrow {
    color: var(--accent-color);
    transform: translateX(3px);
}

/* ============================================
   Tag Management - Toolbar
   ============================================ */
.tag-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
    flex-wrap: wrap;
}

.tag-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tag-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tag-view-toggle {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.tag-view-btn {
    padding: 8px 16px;
    background: #fff;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tag-view-btn:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

.tag-view-btn:hover {
    background: #f5f7fa;
    color: var(--accent-color);
}

.tag-view-btn.active {
    background: var(--primary-color);
    color: #fff;
}

.tag-search {
    position: relative;
}

.tag-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #bbb;
    font-size: 13px;
}

.tag-search input {
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    width: 220px;
    transition: border-color 0.2s, width 0.2s;
    font-family: inherit;
}

.tag-search input:focus {
    outline: none;
    border-color: var(--accent-color);
    width: 280px;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.08);
}

.tag-count-info {
    font-size: 13px;
    color: #999;
    white-space: nowrap;
}

/* ============================================
   Tag Management - List View
   ============================================ */
.tag-table tbody tr {
    transition: background 0.15s ease;
}

.tag-table tbody tr:hover {
    background: #f8faff;
}

.tag-row-num {
    color: #bbb;
    font-size: 13px;
}

.tag-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tag-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tag-name-text {
    font-weight: 500;
    color: #333;
}

.tag-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.tag-category-badge i {
    font-size: 11px;
}

.tag-color-preview {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid rgba(0, 0, 0, 0.06);
}

.tag-campaign-count {
    font-weight: 600;
    color: var(--accent-color);
}

.tag-actions {
    display: flex;
    gap: 6px;
}

/* ============================================
   Tag Management - Category View
   ============================================ */
.tag-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
    padding: 24px;
}

.tag-category-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tag-category-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.tag-category-header {
    padding: 20px 24px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.tag-category-header::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.tag-category-header::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 30%;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}

.tag-category-header-info {
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 1;
}

.tag-category-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    backdrop-filter: blur(4px);
}

.tag-category-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.tag-category-desc {
    font-size: 12px;
    opacity: 0.85;
    font-weight: 400;
}

.tag-category-count {
    background: rgba(255, 255, 255, 0.25);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    z-index: 1;
    backdrop-filter: blur(4px);
}

.tag-category-body {
    padding: 20px 24px;
}

.tag-category-empty {
    color: #bbb;
    font-size: 13px;
    text-align: center;
    padding: 12px 0;
    font-style: italic;
}

.tag-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8f9fc;
    border: 1px solid #e8edf5;
    border-radius: 24px;
    font-size: 13px;
    color: #444;
    cursor: default;
    transition: all 0.2s ease;
    position: relative;
}

.tag-chip:hover {
    background: #eef2ff;
    border-color: var(--chip-color, #ccc);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.tag-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tag-chip-name {
    font-weight: 500;
}

.tag-chip-badge {
    background: var(--accent-color);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.4;
}

/* ============================================
   Tag Management - Empty State
   ============================================ */
.tag-empty-state {
    text-align: center;
    padding: 80px 40px;
    color: #999;
}

.tag-empty-icon {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.tag-empty-state h3 {
    font-size: 18px;
    color: #666;
    margin-bottom: 8px;
}

.tag-empty-state p {
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* ============================================
   Tag Management - Responsive
   ============================================ */
@media (max-width: 900px) {
    .tag-category-grid {
        grid-template-columns: 1fr;
    }

    .tag-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Animation - View transition
   ============================================ */
.tag-content {
    animation: tagFadeIn 0.35s ease;
}

@keyframes tagFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
