/* ======================
   Custom CSS Styles
   ====================== */

:root {
    --brand-primary: #0ea5e9;
    --brand-secondary: #0284c7;
    --brand-dark: #0369a1;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation */
.nav-link {
    transition: all 0.2s ease;
    position: relative;
}

.nav-link.active {
    color: var(--brand-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--brand-primary);
}

/* Upload Dropzone */
#audio-dropzone:hover,
#text-dropzone:hover {
    background-color: rgba(14, 165, 233, 0.05);
}

#audio-dropzone.dragover,
#text-dropzone.dragover {
    border-color: var(--brand-primary);
    background-color: rgba(14, 165, 233, 0.1);
}

/* Tab Button */
.tab-button {
    transition: all 0.2s ease;
}

.tab-button.active {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: #e5e7eb;
    color: #6b7280;
}

.status-badge.processing {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-badge.completed {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.error {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Card Styles */
.knowledge-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.knowledge-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Swipe Card Animation */
.swipe-card {
    position: absolute;
    width: 100%;
    max-width: 600px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.swipe-card.swiping-right {
    transform: translateX(100px) rotate(5deg);
    opacity: 0.8;
}

.swipe-card.swiping-left {
    transform: translateX(-100px) rotate(-5deg);
    opacity: 0.8;
}

.swipe-card.removed {
    display: none;
}

/* Like/Dislike Overlay */
.like-overlay,
.dislike-overlay {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 5rem;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.like-overlay {
    right: 50px;
    color: var(--success);
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.dislike-overlay {
    left: 50px;
    color: var(--danger);
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.swipe-card.swiping-right .like-overlay {
    opacity: 1;
}

.swipe-card.swiping-left .dislike-overlay {
    opacity: 1;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Category Badge */
.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.category-クリエイティブ制作 {
    background-color: #dbeafe;
    color: #1e40af;
}

.category-制作プロセス {
    background-color: #fef3c7;
    color: #92400e;
}

.category-クライアントワーク {
    background-color: #d1fae5;
    color: #065f46;
}

.category-価格戦略 {
    background-color: #fce7f3;
    color: #9f1239;
}

.category-チームマネジメント {
    background-color: #e0e7ff;
    color: #3730a3;
}

.category-技術的洞察 {
    background-color: #f3e8ff;
    color: #6b21a8;
}

/* Tag */
.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: #f3f4f6;
    color: #4b5563;
    margin-right: 6px;
    margin-bottom: 6px;
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--brand-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
}

.modal-content {
    background-color: white;
    border-radius: 1rem;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .swipe-card {
        max-width: 100%;
    }
    
    .like-overlay,
    .dislike-overlay {
        font-size: 3rem;
    }
    
    .like-overlay {
        right: 20px;
    }
    
    .dislike-overlay {
        left: 20px;
    }
    
    .chart-container {
        height: 300px;
    }
}

/* Print Styles */
@media print {
    nav,
    footer,
    .no-print {
        display: none !important;
    }
    
    body {
        background-color: white;
    }
    
    .knowledge-card {
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #e5e7eb;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.4s ease-out;
}

/* Success/Error Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 100;
    animation: slideInRight 0.3s ease-out;
}

.toast.success {
    background-color: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success);
}

.toast.error {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.toast.info {
    background-color: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--brand-primary);
}
