/* iLovePDF 스타일 UI/UX 개선 */

/* Hero Section Enhanced */
.linear-header {
    text-align: center;
    padding: 3rem 0 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0 0 24px 24px;
    margin-bottom: 3rem;
}

[data-theme='dark'] .linear-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.linear-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-neutral-900);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #e53e3e, #ff6b6b);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.linear-header p {
    font-size: 1.1rem;
    color: var(--color-neutral-600);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

[data-theme='dark'] .linear-header p {
    color: var(--color-neutral-300);
}

/* Filter Tabs System */
.category-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.filter-tab {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--color-neutral-700);
    text-decoration: none;
    display: inline-block;
}

.filter-tab:hover,
.filter-tab.active {
    background: #e53e3e;
    color: white;
    border-color: #e53e3e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

[data-theme='dark'] .filter-tab {
    background: var(--color-neutral-800);
    border-color: var(--color-neutral-600);
    color: var(--color-neutral-300);
}

/* Enhanced Tool Cards */
.linear-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.linear-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(229, 62, 62, 0.02), rgba(255, 107, 107, 0.02));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.linear-card:hover::before {
    opacity: 1;
}

.linear-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    border-color: #e53e3e;
}

[data-theme='dark'] .linear-card {
    background: var(--color-neutral-800);
    border-color: var(--color-neutral-700);
}

[data-theme='dark'] .linear-card:hover {
    background: var(--color-neutral-750);
    border-color: #e53e3e;
}

.linear-card > * {
    position: relative;
    z-index: 1;
}

/* Enhanced Tool Icons with Gradients */
.tool-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.3s ease;
}

.linear-card:hover .tool-icon {
    transform: scale(1.1);
}

/* Gradient Icon Backgrounds - Category-based */
/* Image Tools */
.tools-category:nth-child(1) .tool-icon {
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
}

/* PDF Conversion Tools */
.tools-category:nth-child(2) .tool-icon {
    background: linear-gradient(135deg, #2196f3, #1976d2);
}

/* PDF Editing Tools */
.tools-category:nth-child(3) .tool-icon {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
}

/* Convert to PDF Tools */
.tools-category:nth-child(4) .tool-icon {
    background: linear-gradient(135deg, #4caf50, #388e3c);
}

/* Utility Tools */
.tools-category:nth-child(5) .tool-icon {
    background: linear-gradient(135deg, #ffa726, #f57c00);
}

/* Customs Tools */
.tools-category:nth-child(6) .tool-icon {
    background: linear-gradient(135deg, #00bcd4, #0097a7);
}

.tool-icon svg {
    color: white;
    width: 28px;
    height: 28px;
}

/* Enhanced Card Content */
.linear-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-neutral-900);
}

[data-theme='dark'] .linear-card-title {
    color: var(--color-neutral-100);
}

.linear-card-description {
    font-size: 0.9rem;
    color: var(--color-neutral-600);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

[data-theme='dark'] .linear-card-description {
    color: var(--color-neutral-400);
}

/* Enhanced Buttons */
.linear-button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    font-weight: 500;
}

.linear-button-primary {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    border: none;
    color: white;
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.3);
}

.linear-button-primary:hover {
    background: linear-gradient(135deg, #c53030, #a02727);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(229, 62, 62, 0.4);
}

/* New Badge for Featured Tools */
.new-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #e53e3e, #ff6b6b);
    color: white;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.4);
    animation: pulse 2s infinite;
}

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

/* Enhanced Category Titles */
.category-title {
    position: relative;
    padding-left: 1rem;
}

.category-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 2rem;
    background: linear-gradient(135deg, #e53e3e, #ff6b6b);
    border-radius: 2px;
}

/* Enhanced Grid Layout */
.linear-grid-responsive {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(2, 1fr); /* 기본: 모바일에서 2열 */
}

/* 600px 이상: 3열 */
@media (min-width: 600px) {
    .linear-grid-responsive {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 800px 이상: 4열 */
@media (min-width: 800px) {
    .linear-grid-responsive {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 1200px 이상: 5열 */
@media (min-width: 1200px) {
    .linear-grid-responsive {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .linear-header h1 {
        font-size: 2rem;
    }
    
    .linear-card {
        padding: 1.25rem;
    }
    
    .tool-icon {
        width: 48px;
        height: 48px;
    }
    
    .tool-icon svg {
        width: 24px;
        height: 24px;
    }
}

/* Smooth Animations */
@media (prefers-reduced-motion: no-preference) {
    .linear-card,
    .tool-icon,
    .filter-tab,
    .linear-button {
        will-change: transform;
    }
}

/* Loading State for Cards */
.linear-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.linear-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid #e53e3e;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* Enhanced Search/Filter Functionality */
.tool-search {
    max-width: 400px;
    margin: 0 auto 2rem;
    position: relative;
}

.tool-search input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 2px solid var(--color-neutral-200);
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.tool-search input:focus {
    outline: none;
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.tool-search svg {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-neutral-400);
}

/* Enhanced Accessibility */
.linear-card:focus-within {
    outline: 2px solid #e53e3e;
    outline-offset: 2px;
}

/* Enhanced Header Layout */
.linear-navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.linear-navbar-left {
    flex: 0 0 auto;
}

.linear-navbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 2rem;
}

.linear-navbar-utilities {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Brand Enhancement */
.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-main {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary-600);
}

.brand-sub {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--color-neutral-500);
    margin-top: -2px;
}

[data-theme='dark'] .brand-main {
    color: var(--color-primary-400);
}

[data-theme='dark'] .brand-sub {
    color: var(--color-neutral-400);
}

/* Navigation Menu */
.linear-navbar-menu {
    display: flex;
    gap: 2rem;
}

.linear-navbar-link {
    color: var(--color-neutral-700);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.linear-navbar-link:hover {
    color: var(--color-primary-600);
}

.linear-navbar-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #e53e3e, #ff6b6b);
    transition: width 0.3s ease;
}

.linear-navbar-link:hover::after {
    width: 100%;
}

[data-theme='dark'] .linear-navbar-link {
    color: var(--color-neutral-300);
}

[data-theme='dark'] .linear-navbar-link:hover {
    color: var(--color-primary-400);
}

/* Mobile Responsive Header */
@media (max-width: 768px) {
    .linear-navbar-center {
        display: none;
    }
    
    .linear-navbar-content {
        justify-content: space-between;
    }
    
    .brand-text {
        display: none;
    }
    
    .linear-navbar-brand {
        font-size: 1rem;
    }
    
    .linear-navbar-utilities {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .brand-sub {
        display: none;
    }
}

/* Personal Customs Clearance Verification Styles */
.pccc-container {
    max-width: 600px;
    margin: 2rem auto;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.pccc-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(229, 62, 62, 0.02), rgba(255, 107, 107, 0.02));
    z-index: 0;
}

.pccc-container > * {
    position: relative;
    z-index: 1;
}

[data-theme='dark'] .pccc-container {
    background: var(--color-neutral-800);
    border-color: var(--color-neutral-700);
}

.pccc-header {
    text-align: center;
    margin-bottom: 2rem;
}

.pccc-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-neutral-900);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #e53e3e, #ff6b6b);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pccc-subtitle {
    color: var(--color-neutral-600);
    font-size: 1rem;
    line-height: 1.5;
}

[data-theme='dark'] .pccc-subtitle {
    color: var(--color-neutral-400);
}

.pccc-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.pccc-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pccc-label {
    font-weight: 600;
    color: var(--color-neutral-800);
    font-size: 0.9rem;
}

[data-theme='dark'] .pccc-label {
    color: var(--color-neutral-200);
}

.pccc-input {
    padding: 0.75rem 1rem;
    border: 2px solid var(--color-neutral-200);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.pccc-input:focus {
    outline: none;
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

[data-theme='dark'] .pccc-input {
    background: var(--color-neutral-700);
    border-color: var(--color-neutral-600);
    color: var(--color-neutral-200);
}

[data-theme='dark'] .pccc-input:focus {
    border-color: #e53e3e;
}

.pccc-help-text {
    font-size: 0.8rem;
    color: var(--color-neutral-500);
    margin-top: 0.25rem;
}

.pccc-submit {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.3);
}

.pccc-submit:hover {
    background: linear-gradient(135deg, #c53030, #a02727);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(229, 62, 62, 0.4);
}

.pccc-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pccc-result {
    margin-top: 2rem;
    padding: 1rem;
    border-radius: 8px;
    display: none;
}

.pccc-result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.pccc-result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

[data-theme='dark'] .pccc-result.success {
    background: #1e3a2e;
    color: #a3d9a5;
    border-color: #2d5a3d;
}

[data-theme='dark'] .pccc-result.error {
    background: #3a1e1e;
    color: #d9a3a3;
    border-color: #5a2d2d;
}

.pccc-loading {
    display: none;
    text-align: center;
    margin-top: 1rem;
}

.pccc-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e53e3e;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .pccc-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .pccc-title {
        font-size: 1.5rem;
    }
    
    .pccc-subtitle {
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    .linear-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .tool-icon {
        background: none !important;
        border: 1px solid #ddd;
    }
    
    .new-badge {
        display: none;
    }
}