/**
 * AI Tools Finder - Main Stylesheet
 * 한국/필리핀 서비스용 스타일
 */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo a {
    text-decoration: none;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.2s;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.language-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-switcher a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: color 0.2s;
}

.language-switcher a.active {
    color: var(--primary-color);
    font-weight: 600;
}

.auth-buttons, .user-menu {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-link {
    background: transparent;
    color: var(--text-primary);
    padding: 0.5rem;
}

.btn-link:hover {
    color: var(--primary-color);
}

.btn-large {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.search-form {
    max-width: 600px;
    margin: 0 auto;
}

.search-input-wrapper {
    display: flex;
    gap: 0.5rem;
    background: white;
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    box-shadow: var(--shadow-lg);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.search-button {
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.search-button:hover {
    background: var(--primary-dark);
}

/* Tools Layout */
.tools-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    padding: 2rem 0;
}

/* Sidebar */
.sidebar {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    height: fit-content;
    box-shadow: var(--shadow-sm);
}

.filter-section {
    margin-bottom: 2rem;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.category-list, .price-filter-list {
    list-style: none;
}

.category-list li, .price-filter-list li {
    margin-bottom: 0.5rem;
}

.category-list a, .price-filter-list a {
    display: block;
    padding: 0.5rem;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.category-list a:hover, .price-filter-list a:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

.category-list a.active, .price-filter-list a.active {
    background: var(--primary-color);
    color: white;
}

/* Tools Main */
.tools-main {
    min-width: 0;
}

.tools-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.tools-count {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.tools-controls {
    display: flex;
    gap: 1rem;
}

.sort-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tool-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 0;
    overflow: hidden;
}

.tool-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.tool-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tool-logo {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    background: var(--bg-primary);
}

.tool-logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.tool-card .tool-header-info {
    flex: 1;
    min-width: 0;
}

.tool-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.star {
    color: #fbbf24;
    font-size: 0.875rem;
}

.star-empty {
    color: var(--border-color);
}

.rating-value {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-left: 0.25rem;
}

.tool-rating-wrapper {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.tool-rating-wrapper .tool-rating {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}

.tool-card-body {
    flex: 1;
    min-width: 0;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.tool-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tool-name a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.tool-name a:hover {
    color: var(--primary-color);
}

.tool-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.tool-description span {
    display: block;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.tool-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tool-tags {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.tool-price-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.tool-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.price-free {
    background: #d1fae5;
    color: #065f46;
}

.price-paid {
    background: #fee2e2;
    color: #991b1b;
}

.price-freemium {
    background: #dbeafe;
    color: #1e40af;
}

.price-subscription {
    background: #f3e8ff;
    color: #6b21a8;
}

.tool-category {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.tool-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.tool-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-width: 0;
}

.tool-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.like-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    padding: 0.2rem 0.45rem;
}

.like-btn:hover {
    border-color: var(--border-color);
}

.like-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-try {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.tool-card-admin-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.35rem;
    z-index: 20;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tool-card:hover .tool-card-admin-actions {
    opacity: 1;
    transform: translateY(0);
}

.admin-action-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
    color: #fff;
}

.admin-edit-btn {
    background: #2563eb;
}

.admin-delete-btn {
    background: #dc2626;
}

.tool-card-lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.72);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    z-index: 30;
}

@media (max-width: 768px) {
    .tool-card-admin-actions {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tool Detail Page */
.tool-detail-page {
    padding: 2rem 0;
}

.tool-detail-header {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.tool-header-content {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.tool-detail-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    padding: 1rem;
}

.tool-header-info {
    flex: 1;
}

.tool-header-info h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.tool-meta-info {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.tool-rating-large {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-rating-large .star {
    font-size: 1.25rem;
}

.review-count {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.tool-header-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tool-detail-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.tool-main-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.tool-description, .tool-reviews {
    margin-bottom: 2rem;
}

.tool-description:last-child, .tool-reviews:last-child {
    margin-bottom: 0;
}

.tool-description h2, .tool-reviews h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.description-text {
    color: var(--text-secondary);
    line-height: 1.8;
}

.screenshot-image {
    width: 100%;
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

/* Reviews */
.review-form-section {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
}

.review-form-section h3 {
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.25rem;
}

.rating-input input[type="radio"] {
    display: none;
}

.rating-input label {
    font-size: 1.5rem;
    color: var(--border-color);
    cursor: pointer;
    transition: color 0.2s;
}

.rating-input input[type="radio"]:checked ~ label,
.rating-input label:hover,
.rating-input label:hover ~ label {
    color: #fbbf24;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.review-item {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.review-author {
    font-weight: 600;
}

.review-date {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.review-comment {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Tool Sidebar */
.tool-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tool-info-card, .related-tools-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.tool-info-card h3, .related-tools-card h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.info-list {
    list-style: none;
}

.info-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-list li:last-child {
    border-bottom: none;
}

.related-tools-list {
    list-style: none;
}

.related-tools-list li {
    margin-bottom: 1rem;
}

.related-tools-list li:last-child {
    margin-bottom: 0;
}

.related-tools-list a {
    display: flex;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.2s;
}

.related-tools-list a:hover {
    color: var(--primary-color);
}

.related-tool-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.related-tool-info {
    flex: 1;
}

.related-tool-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.related-tool-rating .star {
    font-size: 0.75rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-link {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.pagination-link:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.pagination-link.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-ellipsis {
    padding: 0.5rem;
    color: var(--text-secondary);
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3, .footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

/* Search Page */
.search-page {
    padding: 2rem 0;
}

.search-header {
    text-align: center;
    margin-bottom: 2rem;
}

.search-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.search-query {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.search-form-large {
    max-width: 800px;
    margin: 0 auto 2rem;
}

/* Responsive Design */
@media (max-width: 968px) {
    .tools-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: 2;
    }
    
    .tools-main {
        order: 1;
    }
    
    .tool-detail-content {
        grid-template-columns: 1fr;
    }
    
    .tool-sidebar {
        order: 2;
    }
    
    .tool-main-content {
        order: 1;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .main-nav {
        order: 3;
        width: 100%;
    }
    
    .main-nav ul {
        justify-content: center;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-header-content {
        flex-direction: column;
    }
    
    .tool-header-actions {
        width: 100%;
    }
    
    .tool-header-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    .search-input-wrapper {
        flex-direction: column;
    }
    
    .search-button {
        width: 100%;
    }
}

/* 2026 visual refresh */
:root {
    --primary-color: #03c75a;
    --primary-dark: #02b350;
    --secondary-color: #0ea5e9;
    --success-color: #03c75a;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #111827;
    --text-secondary: #64748b;
    --bg-primary: #ffffff;
    --bg-secondary: #f4f7fb;
    --bg-tertiary: #f8fafc;
    --border-color: rgba(226, 232, 240, 0.95);
    --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 14px 32px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 24px 56px rgba(15, 23, 42, 0.09);
    --radius-sm: 0.75rem;
    --radius-md: 1rem;
    --radius-lg: 1.25rem;
}

body {
    color: var(--text-primary);
    background: linear-gradient(180deg, #f7fafc 0%, #f2f6fb 100%);
}

.btn,
.pagination-link,
.search-button {
    border-radius: 12px;
}

.btn-primary,
.search-button {
    background: linear-gradient(135deg, #03c75a 0%, #08b65a 100%);
    box-shadow: 0 12px 24px rgba(3, 199, 90, 0.14);
}

.btn-primary:hover,
.search-button:hover {
    background: linear-gradient(135deg, #02b350 0%, #04984c 100%);
}

.btn-outline {
    border-color: rgba(203, 213, 225, 0.95);
    color: #334155;
}

.btn-outline:hover {
    background: #f0fdf4;
    border-color: rgba(3, 199, 90, 0.28);
}

.sidebar,
.tool-card,
.tool-info-card,
.related-tools-card,
.search-form-large,
.search-input-wrapper,
.pagination-link,
.no-results {
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.search-input {
    background: transparent;
    color: var(--text-primary);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-section::after {
    content: "";
    position: absolute;
    inset: auto auto -120px -80px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(3, 199, 90, 0.12), transparent 68%);
    filter: blur(8px);
    pointer-events: none;
}

.about-page .about-section,
.news-magazine-wrapper .hero-card,
.news-magazine-wrapper .ls-card,
.news-magazine-wrapper .post-card-lg,
.tool-detail-page .tool-detail-header,
.tool-detail-page .tool-sidebar > *,
.tool-detail-page .review-form-compact,
.tool-detail-page .review-card {
    background: #ffffff !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.07) !important;
}

