/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 15px 0;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.main-nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.main-nav a {
    color: #666;
}

/* Main */
.site-main {
    min-height: calc(100vh - 150px);
    padding: 15px 0 40px;
}

/* Footer */
.site-footer {
    background: #333;
    color: #fff;
    padding: 20px 0;
    text-align: center;
}

/* Hero */
.hero {
    text-align: center;
    padding: 60px 0;
    background: #fff;
    margin: -40px -20px 40px;
    padding-left: 20px;
    padding-right: 20px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* Service Grid */
.services {
    margin-top: 40px;
}

.services h2 {
    margin-bottom: 20px;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.service-card {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #ddd;
    display: block;
    color: inherit;
    transition: box-shadow 0.2s;
}

.service-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-decoration: none;
}

.service-card h3 {
    margin-bottom: 10px;
}

/* Forms */
.auth-form {
    max-width: 400px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #0066cc;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: #0066cc;
    color: #fff;
}

.btn-primary:hover {
    background: #0052a3;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
}

/* Auth links */
.auth-link {
    text-align: center;
    margin-top: 20px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: #f9f9f9;
    font-weight: 600;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 5px;
    margin-top: 20px;
    justify-content: center;
}

.pagination a {
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.pagination a.active {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

/* Tool 랭킹 페이지 */
.tools-header {
    text-align: center;
    margin-bottom: 30px;
}

.tools-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* 카테고리 네비게이션 */
.category-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
}

.category-nav a {
    padding: 8px 16px;
    background: #f0f0f0;
    border-radius: 20px;
    color: #666;
    font-size: 0.9rem;
}

.category-nav a:hover,
.category-nav a.active {
    background: #0066cc;
    color: #fff;
    text-decoration: none;
}

/* 필터 바 */
.filter-bar {
    margin-bottom: 20px;
}

.filter-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-form select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #fff;
}

/* Tool 목록 */
.tool-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tool-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
    align-items: flex-start;
}

.tool-card .rank {
    font-size: 1.5rem;
    font-weight: bold;
    color: #0066cc;
    min-width: 40px;
}

.tool-card .tool-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.tool-card .tool-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.tool-card .no-image {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #999;
    font-size: 0.8rem;
}

.tool-card .tool-info {
    flex: 1;
}

.tool-card .tool-info h3 {
    margin-bottom: 8px;
}

.tool-card .tool-info h3 a {
    color: #333;
}

.tool-card .description {
    color: #666;
    margin-bottom: 10px;
}

.tool-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.tool-meta span {
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 0.8rem;
}

.tool-meta .price.free { background: #d4edda; color: #155724; }
.tool-meta .price.paid { background: #f8d7da; color: #721c24; }
.tool-meta .price.freemium { background: #fff3cd; color: #856404; }

.tool-stats {
    font-size: 0.85rem;
    color: #999;
}

.tool-stats span {
    margin-right: 15px;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Tool 상세 페이지 */
.tool-detail {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
}

.tool-detail-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.tool-detail-image {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}

.tool-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.tool-detail-info {
    flex: 1;
}

.breadcrumb {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.breadcrumb a {
    color: #666;
}

.tool-detail-info h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.tool-meta-detail {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.meta-item .label {
    font-size: 0.85rem;
    color: #999;
    display: block;
}

.meta-item .value {
    font-weight: 500;
}

.tool-stats-detail {
    margin: 15px 0;
    color: #666;
}

.tool-stats-detail span {
    margin-right: 20px;
}

.tool-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-recommend {
    background: #ff6b6b;
    color: #fff;
}

.btn-recommend:hover {
    background: #ee5a5a;
}

.tool-pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.pros h3 { color: #28a745; }
.cons h3 { color: #dc3545; }

.back-link {
    margin-top: 20px;
}

/* 비교 페이지 */
.compare-form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.compare-select {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.compare-select select {
    padding: 10px 15px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 200px;
}

.compare-select .vs {
    font-weight: bold;
    font-size: 1.2rem;
    color: #999;
}

.compare-table-wrap {
    overflow-x: auto;
}

.compare-table {
    background: #fff;
    border-radius: 8px;
}

.compare-table th,
.compare-table td {
    text-align: center;
    vertical-align: top;
}

.compare-table th:first-child,
.compare-table td:first-child {
    text-align: left;
    background: #f9f9f9;
    font-weight: 500;
}

.compare-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

/* 반응형 */
@media (max-width: 768px) {
    .tool-card {
        flex-direction: column;
    }

    .tool-card .tool-image {
        width: 100%;
        height: 150px;
    }

    .tool-detail-header {
        flex-direction: column;
    }

    .tool-detail-image {
        width: 100%;
        height: 200px;
    }

    .tool-pros-cons {
        grid-template-columns: 1fr;
    }

    .compare-select {
        flex-direction: column;
    }
}
