/* Custom CSS for Real Estate Anomaly Detection System */

/* Font Configuration */
.font-noto {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Tab Navigation */
.nav-tab {
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-tab.active {
    border-bottom-color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-tab:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Risk Level Indicators */
.risk-low {
    @apply bg-green-100 text-green-800 border border-green-200;
}

.risk-medium {
    @apply bg-yellow-100 text-yellow-800 border border-yellow-200;
}

.risk-high {
    @apply bg-red-100 text-red-800 border border-red-200;
}

.risk-critical {
    @apply bg-purple-100 text-purple-800 border border-purple-200;
}

/* Risk Score Badge */
.risk-score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 18px;
    margin-right: 1rem;
}

.risk-score-low {
    @apply bg-green-500 text-white;
}

.risk-score-medium {
    @apply bg-yellow-500 text-white;
}

.risk-score-high {
    @apply bg-red-500 text-white;
}

.risk-score-critical {
    @apply bg-purple-500 text-white;
}

/* Anomaly Alert Cards */
.anomaly-card {
    @apply bg-red-50 border-l-4 border-red-500 p-4 rounded-r-lg;
    transition: all 0.3s ease;
}

.anomaly-card:hover {
    @apply shadow-lg;
    transform: translateY(-2px);
}

.normal-card {
    @apply bg-green-50 border-l-4 border-green-500 p-4 rounded-r-lg;
    transition: all 0.3s ease;
}

.normal-card:hover {
    @apply shadow-lg;
    transform: translateY(-2px);
}

/* Data Table Enhancements */
.data-table {
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.data-table tr:hover {
    @apply bg-gray-50;
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: rgb(59, 130, 246);
    animation: spin 1s ease-in-out infinite;
}

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

/* Custom Form Styling */
.form-group {
    position: relative;
}

.form-input {
    @apply w-full p-3 border border-gray-300 rounded-lg;
    transition: all 0.3s ease;
}

.form-input:focus {
    @apply ring-2 ring-blue-500 border-transparent;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-label {
    @apply block text-sm font-medium text-gray-700 mb-2;
}

/* Chart Container Styling */
.chart-container {
    position: relative;
    height: 400px;
    margin: 1rem 0;
}

.chart-container canvas {
    max-height: 100% !important;
}

/* Status Indicators */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-active {
    @apply bg-green-500;
    animation: pulse 2s infinite;
}

.status-warning {
    @apply bg-yellow-500;
}

.status-error {
    @apply bg-red-500;
}

.status-inactive {
    @apply bg-gray-400;
}

/* Notification Badges */
.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Progress Bars */
.progress-bar {
    @apply bg-gray-200 rounded-full h-2 overflow-hidden;
}

.progress-fill {
    @apply h-full transition-all duration-500 ease-out;
}

.progress-low {
    @apply bg-green-500;
}

.progress-medium {
    @apply bg-yellow-500;
}

.progress-high {
    @apply bg-red-500;
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .nav-tab {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .risk-score-badge {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }
    
    .chart-container {
        height: 300px;
    }
}

@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .grid {
        gap: 1rem;
    }
    
    .nav-tab {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}

/* Print Styles */
@media print {
    .nav-tab,
    button,
    .hidden {
        display: none !important;
    }
    
    .tab-content {
        display: block !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* Accessibility Enhancements */
.focus-visible:focus {
    outline: 2px solid rgb(59, 130, 246);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bounce-in {
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}