/**
 * Freepeia AI Directory - Frontend Styles
 */

/* Base Styles */
.freepeia-directory-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #1e1e1e;
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Filters */
.freepeia-filters {
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.freepeia-search {
    display: flex;
    margin-bottom: 15px;
}

.freepeia-search input[type="text"] {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 16px;
    line-height: 1.5;
    transition: border-color 0.3s ease;
}

.freepeia-search input[type="text"]:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.freepeia-search button {
    background: #007cba;
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.freepeia-search button:hover {
    background: #006ba1;
}

.freepeia-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.freepeia-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.freepeia-filter label {
    font-weight: 500;
    color: #3c434a;
}

.freepeia-filter select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    color: #1e1e1e;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.freepeia-filter select:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

/* Grid Layout */
.freepeia-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

.freepeia-grid-cols-1 {
    grid-template-columns: 1fr;
}

.freepeia-grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.freepeia-grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.freepeia-grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Tool Card */
.freepeia-tool-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.freepeia-tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #cce5ff;
}

.freepeia-tool-card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.freepeia-tool-image {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.freepeia-tool-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.freepeia-tool-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.freepeia-tool-badge.free {
    background-color: rgba(0, 163, 42, 0.15);
    color: #00a32a;
}

.freepeia-tool-badge.premium {
    background-color: rgba(214, 54, 56, 0.15);
    color: #d63638;
}

.freepeia-tool-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.freepeia-tool-title {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.4;
}

.freepeia-tool-title a {
    color: #1e1e1e;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.freepeia-tool-title a:hover {
    color: #007cba;
}

.freepeia-tool-title .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.freepeia-tool-description {
    color: #646970;
    margin: 0 0 15px;
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
}

.freepeia-tool-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f1;
    font-size: 13px;
    color: #757575;
}

.freepeia-tool-updated {
    display: flex;
    align-items: center;
    gap: 5px;
}

.freepeia-tool-updated .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.freepeia-tool-more {
    background: none;
    border: none;
    color: #007cba;
    padding: 0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
    transition: color 0.3s ease;
}

.freepeia-tool-more:hover {
    color: #005177;
}

.freepeia-tool-more .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.freepeia-tool-more:hover .dashicons {
    transform: translateX(3px);
}

/* No Results */
.freepeia-no-results {
    text-align: center;
    padding: 40px 20px;
    grid-column: 1 / -1;
    color: #646970;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #ddd;
}

/* Loading Spinner */
.freepeia-loading {
    text-align: center;
    padding: 40px 20px;
    grid-column: 1 / -1;
    color: #646970;
}

.freepeia-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #007cba;
    animation: freepeia-spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

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

/* Pagination */
.freepeia-pagination {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
    gap: 8px;
}

.freepeia-pagination a,
.freepeia-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #1e1e1e;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.freepeia-pagination a:hover {
    background: #f5f5f5;
    border-color: #999;
}

.freepeia-pagination .current {
    background: #007cba;
    border-color: #007cba;
    color: #fff;
}

.freepeia-pagination .dots {
    background: transparent;
    border: none;
    cursor: default;
}

/* Modal */
.freepeia-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.freepeia-modal.active {
    display: flex;
    opacity: 1;
}

.freepeia-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.freepeia-modal.active .freepeia-modal-content {
    transform: translateY(0);
}

.freepeia-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.freepeia-modal-close:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: rotate(90deg);
}

.freepeia-modal-body {
    padding: 0;
    max-height: calc(90vh - 60px);
    overflow-y: auto;
}

/* Tool Detail View */
.freepeia-tool-detail {
    display: flex;
    flex-direction: column;
}

.freepeia-tool-detail-header {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.freepeia-tool-detail-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.freepeia-tool-detail-header .freepeia-tool-badge {
    top: 20px;
    right: 20px;
    padding: 6px 15px;
    font-size: 12px;
}

.freepeia-tool-detail-content {
    padding: 30px;
}

.freepeia-tool-detail-title {
    margin: 0 0 15px;
    font-size: 28px;
    line-height: 1.3;
}

.freepeia-tool-detail-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    color: #646970;
    font-size: 14px;
}

.freepeia-tool-detail-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.freepeia-tool-detail-meta .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.freepeia-tool-detail-description {
    margin-bottom: 25px;
    line-height: 1.7;
    color: #3c434a;
}

.freepeia-tool-detail-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f1;
}

.freepeia-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    gap: 8px;
}

.freepeia-button-primary {
    background: #007cba;
    color: white;
}

.freepeia-button-primary:hover {
    background: #006ba1;
    color: white;
}

.freepeia-button-secondary {
    background: #f0f0f1;
    color: #1e1e1e;
}

.freepeia-button-secondary:hover {
    background: #e0e0e0;
    color: #1e1e1e;
}

.freepeia-button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Responsive Styles */
@media screen and (max-width: 1024px) {
    .freepeia-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .freepeia-grid-cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .freepeia-filters {
        padding: 15px;
    }
    
    .freepeia-filter-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .freepeia-filter {
        width: 100%;
    }
    
    .freepeia-filter select {
        flex: 1;
    }
    
    .freepeia-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .freepeia-grid-cols-2,
    .freepeia-grid-cols-3,
    .freepeia-grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .freepeia-tool-detail-header {
        height: 200px;
    }
    
    .freepeia-tool-detail-content {
        padding: 20px;
    }
    
    .freepeia-tool-detail-title {
        font-size: 24px;
    }
    
    .freepeia-tool-detail-actions {
        flex-direction: column;
    }
    
    .freepeia-button {
        width: 100%;
        text-align: center;
    }
}
