/* ============================================================
   TOOLS.CSS - صفحة الأدوات
   ============================================================ */

/* ====== HERO ====== */
.tools-hero {
    padding: 140px 0 60px;
    background: var(--bg-secondary);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tools-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 40%, rgba(108,60,225,0.08), transparent 60%);
    animation: heroGlow 6s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% { opacity: 0.6; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.05); }
}

.tools-hero .container { position: relative; z-index: 2; }

.tools-hero .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(108,60,225,0.12);
    color: var(--primary);
    padding: 8px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 20px;
    border: 1px solid rgba(108,60,225,0.15);
}

.tools-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 8px;
}

.tools-hero h1 .highlight {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tools-hero h1 .subtitle {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: var(--text-secondary);
    font-weight: 600;
}

.tools-hero .hero-desc {
    color: var(--text-secondary);
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.8;
}

.tools-hero .hero-stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
}

.tools-hero .hero-stats .stat-item { text-align: center; }

.tools-hero .hero-stats .stat-number {
    display: block;
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1.2;
}

.tools-hero .hero-stats .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ====== FILTERS ====== */
.tools-filters {
    padding: 20px 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 70px;
    z-index: 39;
    backdrop-filter: blur(20px);
    background: rgba(10, 10, 26, 0.92);
}

[data-theme="light"] .tools-filters {
    background: rgba(255, 255, 255, 0.92);
}

.filter-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-tabs button {
    padding: 6px 18px;
    border: 2px solid var(--border);
    border-radius: 50px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tabs button:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.filter-tabs button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(108, 60, 225, 0.25);
}

.filter-tabs button .count {
    background: rgba(255,255,255,0.15);
    padding: 0 8px;
    border-radius: 50px;
    font-size: 0.65rem;
    margin-right: 4px;
}

.filter-tabs button.active .count {
    background: rgba(255,255,255,0.2);
}

.filter-search input {
    padding: 8px 16px;
    border-radius: 50px;
    border: 2px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    width: 220px;
    transition: all 0.3s ease;
}

.filter-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 60, 225, 0.08);
}

/* ====== TOOLS GRID ====== */
.tools-grid-section {
    padding: 40px 0 60px;
    background: var(--bg);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
}

/* ====== TOOL CARD ====== */
.tool-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.4s ease;
    position: relative;
}

.tool-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.tool-card .tool-image {
    position: relative;
    height: 180px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tool-card .tool-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.6s ease;
}

.tool-card:hover .tool-image img {
    transform: scale(1.05);
}

.tool-card .tool-image .tool-icon {
    font-size: 4rem;
    color: var(--primary);
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.tool-card .tool-image .tool-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    z-index: 2;
}

.tool-card .tool-image .tool-badge.free {
    background: linear-gradient(135deg, #2ECC71, #27AE60);
}

.tool-card .tool-image .tool-badge.paid {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.tool-card .tool-image .tool-status-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 3px 12px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 700;
    backdrop-filter: blur(10px);
    z-index: 2;
}

.tool-card .tool-image .tool-status-badge.active {
    background: rgba(46,204,113,0.85);
    color: #fff;
}

.tool-card .tool-image .tool-status-badge.inactive {
    background: rgba(231,76,60,0.85);
    color: #fff;
}

.tool-card .tool-image .tool-upgrade-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(241,196,15,0.9);
    color: #1a1a1a;
    z-index: 2;
}

.tool-card .tool-body {
    padding: 20px 24px;
}

.tool-card .tool-body .tool-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.tool-card .tool-body .tool-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    flex: 1;
    color: var(--text);
}

.tool-card .tool-body .tool-category {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
    margin-bottom: 10px;
}

.tool-card .tool-body .tool-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-card .tool-body .tool-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.tool-card .tool-body .tool-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tool-card .tool-body .tool-meta .rating {
    color: #F1C40F;
}

.tool-card .tool-body .tool-footer {
    display: flex;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.tool-card .tool-body .tool-footer .btn {
    padding: 8px 16px;
    font-size: 0.8rem;
}

/* ====== EMPTY STATE ====== */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    display: block;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.4rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 1rem;
}

/* ====== LOADING ====== */
.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
}

.loading-spinner .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

/* ====== TOAST ====== */
.toast-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    min-width: 280px;
    max-width: 400px;
    box-shadow: var(--shadow-hover);
    animation: slideInRight 0.4s ease;
}

.toast-item.success { border-right: 4px solid #2ECC71; }
.toast-item.error { border-right: 4px solid #E74C3C; }
.toast-item.warning { border-right: 4px solid #F1C40F; }
.toast-item.info { border-right: 4px solid #6C3CE1; }

.toast-item .toast-title { font-weight: 700; }
.toast-item .toast-message { color: var(--text-secondary); font-size: 0.9rem; }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ====== RESPONSIVE ====== */
@media (max-width: 992px) {
    .tools-hero h1 { font-size: 2.8rem; }
    .tools-hero .hero-stats { gap: 30px; }
    .tools-hero .hero-stats .stat-number { font-size: 2rem; }
}

@media (max-width: 768px) {
    .tools-hero { padding: 120px 0 40px; }
    .tools-hero h1 { font-size: 2rem; }
    .tools-hero .hero-desc { font-size: 1rem; }
    
    .filter-wrapper { flex-direction: column; align-items: stretch; }
    .filter-tabs { justify-content: center; gap: 6px; }
    .filter-tabs button { padding: 4px 12px; font-size: 0.7rem; }
    .filter-search input { width: 100%; }
    
    .tools-grid { grid-template-columns: 1fr; gap: 20px; }
    .tools-hero .hero-stats { gap: 20px; }
    .tools-hero .hero-stats .stat-number { font-size: 1.6rem; }
    
    .tool-card .tool-image { height: 140px; }
    
    .toast-container { right: 10px; left: 10px; }
    .toast-item { min-width: auto; max-width: 100%; }
}

@media (max-width: 480px) {
    .tools-hero h1 { font-size: 1.6rem; }
    .tools-hero .subtitle { font-size: 1rem; }
    .filter-tabs button { font-size: 0.6rem; padding: 3px 10px; }
    
    .tool-card .tool-body .tool-footer { flex-direction: column; }
    .tool-card .tool-body .tool-footer .btn { width: 100%; }
    
    .hero-stats .stat-number { font-size: 1.3rem; }
}