/* Tool Facebook */
.tool-section {
    padding: 80px 0;
    background: #f8f9fa;
    min-height: 60vh;
}

.tool-layout {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    align-items: flex-start;
}

/* ─── Sidebar ─── */

.tool-sidebar {
    width: 180px;
    flex-shrink: 0;
    background: var(--light-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: sticky;
    top: 90px;
}

.tool-tab {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--dark-color);
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.tool-tab:hover {
    background: #f8f9fa;
}

.tool-tab.active {
    background: #fff0f3;
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.tool-tab i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
}

/* ─── Content ─── */

.tool-content {
    flex: 1;
    min-width: 0;
}

.tool-card {
    background: var(--light-color);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
}

.tool-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    color: var(--dark-color);
}

.tool-card .tool-desc {
    color: var(--gray-color);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* ─── Forms ─── */

.tool-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tool-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.tool-form label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-color);
}

.tool-form input,
.tool-form textarea,
.tool-form select {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.tool-form input:focus,
.tool-form textarea:focus,
.tool-form select:focus {
    border-color: var(--primary-color);
}

.tool-form textarea {
    min-height: 80px;
    resize: vertical;
}

.tool-form .btn {
    justify-content: center;
}

/* ─── Cookie list ─── */

.cookie-list {
    background: #f8f9fa;
    border-radius: var(--radius);
    padding: 0.6rem;
}

.cookie-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius);
    background: var(--light-color);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    margin-bottom: 0.4rem;
}

.cookie-item:last-child {
    margin-bottom: 0;
}

.cookie-item:hover {
    border-color: var(--secondary-color);
}

.cookie-item.active {
    border-color: var(--primary-color);
    background: #fff0f3;
}

.cookie-item .cookie-info {
    flex: 1;
    min-width: 0;
}

.cookie-item .cookie-uid {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-color);
}

.cookie-item .cookie-remove {
    background: none;
    border: none;
    color: var(--gray-color);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 6px;
    transition: var(--transition);
}

.cookie-item .cookie-remove:hover {
    color: var(--error-color);
}

.cookie-item .cookie-check {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.cookie-item.active .cookie-check {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.cookie-item.active .cookie-check::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #fff;
    font-size: 0.6rem;
}

/* ─── Result ─── */

.tool-result {
    margin-top: 1rem;
    border-radius: var(--radius);
    background: #f8f9fa;
    display: none;
}

.tool-result.show {
    display: block;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: var(--light-color);
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--gray-color);
    font-weight: 500;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.75rem;
    padding: 0.75rem;
    max-height: 70vh;
    overflow-y: auto;
}

.result-group {
    background: var(--light-color);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-group:hover {
    box-shadow: var(--shadow);
}

.result-group .group-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark-color);
    line-height: 1.3;
}

.result-group .group-info {
    font-size: 0.8rem;
    color: var(--gray-color);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-group .group-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--gray-color);
}

.result-group .group-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.result-group .group-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

/* ─── Spinner ─── */

.spinner-sm {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: var(--light-color);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Buttons ─── */

.btn-join {
    padding: 6px 16px;
    background: var(--primary-color);
    color: var(--light-color);
    border: none;
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-join:hover {
    background: #d60043;
    transform: scale(1.03);
}

.btn-join:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-join.joined {
    background: var(--success-color);
    cursor: default;
}

.btn-sm-outline {
    padding: 4px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.8rem;
    color: var(--gray-color);
    cursor: pointer;
    transition: var(--transition);
}

.btn-sm-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ─── Responsive ─── */

@media (max-width: 768px) {
    .tool-layout {
        flex-direction: column;
    }
    .tool-sidebar {
        width: 100%;
        display: flex;
        position: static;
    }
    .tool-tab {
        flex: 1;
        justify-content: center;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    .tool-tab.active {
        border-bottom-color: var(--primary-color);
    }
    .result-grid {
        grid-template-columns: 1fr;
    }
}
