/* =================================================================
   PROJECTS PAGE - UNIFIED STYLES
   Modern Dark Theme + Custom Components
   ================================================================= */

/* Import base tool-style for header/footer */
@import url('tool-style.css');

/* =================================================================
   CSS VARIABLES
   ================================================================= */

:root {
    --project-primary: #00d4ff;
    --project-secondary: #7c3aed;
    --project-accent: #f59e0b;
    --project-success: #10b981;
    --project-card-bg: #1e293b;
    --project-card-hover: #2d3748;
}

/* =================================================================
   PAGE LAYOUT
   ================================================================= */

.projects-page {
    background: linear-gradient(135deg, #0a0e13 0%, #1a1f26 100%);
    overflow-x: hidden;
}

.projects-main-content {
    padding-top: 6rem;
    min-height: 100vh;
}

.projects-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
}

/* =================================================================
   BADGE SYSTEM
   ================================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.badge-featured, .badge.featured {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.badge-trending, .badge.trending {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.badge-opensource, .badge.open {
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

.badge-free, .badge.free {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.badge-paid, .badge.paid {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.badge-freemium, .badge.freemium {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.project-badges-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px;
    padding: 24px 20px 16px 0px;
    min-height: 60px;
}

.badges-divider {
    display: block;
    width: calc(100% - 20px);
    height: 1px;
    margin: 1rem 20px 1.25rem 0;
    background: linear-gradient(90deg, 
        #667eea 0%, 
        #764ba2 25%,
        #ff6b6b 50%,
        #764ba2 75%,
        #667eea 100%);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
    opacity: 1;
}

/* =================================================================
   FEATURED PROJECTS BANNER
   ================================================================= */

.featured-projects-banner {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(0, 212, 255, 0.1));
    border-bottom: 2px solid var(--border-color);
    padding: 3rem 0;
    margin-bottom: 3rem;
}

.featured-projects-banner .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-title {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
    background: linear-gradient(135deg, var(--project-primary), var(--project-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.featured-card {
    background: var(--project-card-bg);
    border: 2px solid var(--project-secondary);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.featured-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--project-primary), var(--project-secondary), var(--project-accent));
}

.featured-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(124, 58, 237, 0.3);
    border-color: var(--project-primary);
}

.featured-card-content {
    padding: 2rem;
}

.featured-header {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.featured-badge, .trending-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.featured-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1a1f26;
}

.trending-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.featured-card h3 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.featured-card p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.featured-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.featured-stats .stat {
    padding: 0.5rem 1rem;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 20px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

.featured-btn {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, var(--project-primary), var(--project-secondary));
    color: white;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.featured-btn:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
    color: white;
}

/* =================================================================
   FILTERS SIDEBAR
   ================================================================= */

.filters-sidebar {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    height: fit-content;
    position: sticky;
    top: 7rem;
}

.filter-section {
    margin-bottom: 2rem;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--project-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding-left: 2rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.filter-checkbox:hover {
    color: var(--project-primary);
}

.filter-checkbox input[type="checkbox"],
.filter-checkbox input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.filter-checkbox:hover input ~ .checkmark {
    border-color: var(--project-primary);
}

.filter-checkbox input:checked ~ .checkmark {
    background-color: var(--project-primary);
    border-color: var(--project-primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
}

.filter-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.apply-filters-btn, 
.clear-filters, 
.clear-filters-btn {
    width: 100%;
    padding: 0.875rem;
    margin-top: 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    cursor: pointer;
}

.apply-filters-btn {
    background: linear-gradient(135deg, var(--project-primary), var(--project-secondary));
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.apply-filters-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

.clear-filters, 
.clear-filters-btn {
    background: var(--card-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    margin-top: 0.75rem;
}

.clear-filters:hover, 
.clear-filters-btn:hover {
    background: var(--secondary-bg);
    border-color: var(--project-primary);
    color: var(--project-primary);
}

/* =================================================================
   PROJECT CARDS
   ================================================================= */

.tool-card-header {
    display: flex;
    flex-direction: column;
    padding: 0;
    margin-bottom: 0;
}

.tool-card-body {
    padding: 0 20px 1rem 0;
}

.title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.title-row .tool-name {
    flex: 1;
    margin: 0;
}

/* Bookmark button */
.bookmark-btn {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 0.35rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.bookmark-btn:hover {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.08);
    transform: translateY(-1px);
}

.bookmark-btn.bookmarked {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.12);
}

.bookmark-btn .heart-icon {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.bookmark-btn:hover .heart-icon {
    color: #ff6b6b;
}

.bookmark-btn.bookmarked .heart-icon {
    fill: #ff6b6b;
    color: #ff6b6b;
    animation: heartbeat 0.3s ease;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Card footer buttons */
.tool-card-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 20px 1rem 0;
    margin-left: 0;
    margin-right: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary-project,
.btn-secondary-project {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary-project {
    background: linear-gradient(135deg, var(--project-primary), var(--project-secondary));
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary-project:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
    color: white;
}

.btn-secondary-project {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary-project:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 1rem;
}

/* =================================================================
   LANGUAGE ICONS
   ================================================================= */

.lang-tag {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--lang-color, var(--project-primary));
    border-radius: 20px;
    color: var(--lang-color, var(--project-primary));
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.lang-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.lang-icon-small {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.filter-lang-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    margin-right: 0.25rem;
}

/* =================================================================
   PROJECTS SECTION
   ================================================================= */

.projects-section {
    min-height: 600px;
}

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.header-left h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.projects-count {
    color: var(--text-muted);
    font-size: 1rem;
}

.projects-count span {
    color: var(--project-primary);
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sort-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sort-form label {
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.sort-select {
    padding: 0.75rem 1rem;
    background: var(--secondary-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
}

.sort-select:focus {
    outline: none;
    border-color: var(--project-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.project-card {
    background: var(--project-card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(124, 58, 237, 0.25);
    border-color: var(--project-secondary);
}

/* =================================================================
   TOAST NOTIFICATIONS
   ================================================================= */

.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
}

.toast-info {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.toast-error {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
}

/* =================================================================
   NO RESULTS
   ================================================================= */

.no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.no-results h3 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.no-results p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.btn-primary {
    display: inline-block;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--project-primary), var(--project-secondary));
    color: white;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
    color: white;
}

/* =================================================================
   PAGINATION
   ================================================================= */

.pagination-container {
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
}

.pagination-number.active {
    background: linear-gradient(135deg, var(--project-primary), var(--project-secondary));
}

/* =================================================================
   RESPONSIVE DESIGN
   ================================================================= */

@media (max-width: 1200px) {
    .projects-container {
        grid-template-columns: 260px 1fr;
        gap: 2rem;
    }
    
    .featured-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 992px) {
    .projects-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .filters-sidebar {
        position: relative;
        top: 0;
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .projects-main-content {
        padding-top: 5rem;
    }
    
    .featured-projects-banner {
        padding: 2rem 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .projects-container {
        padding: 0 1rem 3rem;
    }
    
    .projects-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-left h1 {
        font-size: 2rem;
    }
    
    .header-right {
        width: 100%;
    }
    
    .sort-form {
        width: 100%;
        justify-content: space-between;
    }
    
    .sort-select {
        flex: 1;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-badges-top {
        padding: 0.875rem 0.875rem 0.875rem 0.875rem;
        gap: 0.4rem;
    }
    
    .badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
    
    .badges-divider {
        width: calc(100% - 1.75rem);
        margin: 0 0.875rem 1rem 0.875rem;
    }
    
    .tool-card-body {
        padding: 0.875rem;
    }
    
    .btn-primary-project,
    .btn-secondary-project {
        font-size: 0.8rem;
        padding: 0.65rem 0.75rem;
    }
    
    .tool-card-footer {
        gap: 0.5rem;
        padding: 0.875rem;
    }
    
    .bookmark-btn {
        min-width: 32px;
        height: 32px;
        padding: 0.4rem;
    }
    
    .bookmark-btn .heart-icon {
        width: 18px;
        height: 18px;
    }
    
    .toast-notification {
        bottom: 20px;
        right: 20px;
        left: 20px;
        padding: 0.875rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .projects-main-content {
        padding-top: 4rem;
    }
    
    .featured-projects-banner .container {
        padding: 0 1rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .featured-card-content {
        padding: 1.5rem;
    }
    
    .featured-card h3 {
        font-size: 1.5rem;
    }
    
    .projects-container {
        padding: 0 0.5rem 2rem;
    }
    
    .filters-sidebar {
        padding: 1.5rem;
    }
    
    .project-footer {
        flex-direction: column;
    }
    
    .btn-details, .btn-demo {
        width: 100%;
    }
}

/* =================================================================
   ADDITIONAL RESPONSIVE FIXES (Projects page)
   - Avoid overflow on small screens
   - Improve header controls layout
   ================================================================= */

@media (max-width: 992px) {
    .tools-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-container {
        min-width: 0;
    }

    .sort-section {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .sort-section .sort-select {
        flex: 1 1 240px;
        min-width: 0;
        width: 100%;
    }

    .tools-count {
        width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

@media (max-width: 768px) {
    .filters-sidebar {
        padding: 1.25rem;
    }

    .tool-card-footer {
        flex-direction: column;
    }

    .btn-primary-project,
    .btn-secondary-project {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .filters-sidebar {
        padding: 1rem;
    }

    .tools-count {
        font-size: 0.9rem;
    }
}
