/* ===================================
   Data Viewer Styles
   =================================== */

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

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f5f7fa;
}

/* ===================================
   Header
   =================================== */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    height: 60px;
    width: auto;
    border-radius: 8px;
}

.title-group h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.title-group h1 i {
    margin-right: 0.5rem;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

.back-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateX(-5px);
}

/* ===================================
   Main Content
   =================================== */
.main-content {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* ===================================
   Upload Section
   =================================== */
.upload-section {
    margin-bottom: 2rem;
}

.upload-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.upload-icon {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.upload-card h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.help-text {
    color: #666;
    margin-bottom: 1.5rem;
}

.upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 12px;
    padding: 3rem 2rem;
    background: #f7fafc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: #667eea;
    background: #edf2f7;
}

.upload-area i {
    font-size: 3rem;
    color: #667eea;
    display: block;
    margin-bottom: 1rem;
}

.upload-area p {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.upload-area span {
    display: block;
    color: #a0aec0;
    margin: 0.5rem 0;
}

.btn-upload {
    margin-top: 1rem;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.file-info {
    margin-top: 1rem;
    padding: 1rem;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    color: #155724;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-info i {
    font-size: 1.5rem;
}

/* ===================================
   Statistics Section
   =================================== */
.stats-section {
    margin-bottom: 2rem;
}

.stats-section h2 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

.stat-icon.total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon.invasive {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-icon.rare {
    background: linear-gradient(135deg, #fad0c4 0%, #ffd1ff 100%);
}

.stat-icon.native {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.stat-info h3 {
    font-size: 2rem;
    color: #333;
    font-weight: 700;
}

.stat-info p {
    color: #666;
    font-size: 0.9rem;
}

/* ===================================
   Control Section
   =================================== */
.control-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.control-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 2.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 0.5rem;
}

.filter-group,
.sort-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label,
.sort-group label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.filter-group select,
.sort-group select {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-group select:focus,
.sort-group select:focus {
    outline: none;
    border-color: #667eea;
}

.result-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.result-info span {
    font-weight: 600;
    color: #4a5568;
}

.btn-export {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ===================================
   Table Section
   =================================== */
.table-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.data-table tbody tr:hover {
    background: #f7fafc;
}

.data-table td {
    padding: 1rem;
    color: #4a5568;
}

.species-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.species-badge.native {
    background: #c6f6d5;
    color: #22543d;
}

.species-badge.invasive {
    background: #fed7d7;
    color: #742a2a;
}

.species-badge.rare {
    background: #feebc8;
    color: #7c2d12;
}

.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    background: #e2e8f0;
    color: #4a5568;
}

.btn-detail {
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.btn-detail:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

/* ===================================
   No Data Message
   =================================== */
.no-data {
    background: white;
    border-radius: 12px;
    padding: 4rem 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.no-data i {
    font-size: 4rem;
    color: #cbd5e0;
    margin-bottom: 1rem;
}

.no-data h3 {
    font-size: 1.5rem;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.no-data p {
    color: #a0aec0;
}

/* ===================================
   Modal
   =================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    font-size: 1.3rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.detail-group {
    margin-bottom: 1.5rem;
}

.detail-group label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.detail-group .value {
    color: #2d3748;
    font-size: 1rem;
}

.detail-group img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 0.5rem;
}

/* ===================================
   Notification
   =================================== */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid #48bb78;
}

.notification.error {
    border-left: 4px solid #f56565;
}

.notification.info {
    border-left: 4px solid #4299e1;
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo {
        height: 50px;
    }
    
    .title-group h1 {
        font-size: 1.3rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .control-bar {
        flex-direction: column;
    }
    
    .search-box {
        width: 100%;
    }
    
    .table-container {
        overflow-x: scroll;
    }
    
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
}
