/* 
   Xserver Log Parser Design System
   Based on webapps/style.css
*/

:root {
    --bg-color: #f8fafb;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --brand-green: #01894d;
    --brand-orange: #f39800;
    --accent-color: #f0fdf4;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
    --radius: 12px;
}

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

body {
    font-family: 'Noto Sans JP', 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
.main-header {
    background-color: var(--brand-green);
    border-bottom: 3px solid var(--brand-orange);
    padding: 12px 0;
    color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-icon {
    width: 28px;
    height: 28px;
}

.brand-logo {
    font-size: 1.25rem;
    font-weight: 800;
}

.btn-home {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-home:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Container */
.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 20px;
}

/* Info Section */
.info-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 2rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.info-header {
    padding: 1rem 1.5rem;
    background: #fdfdfd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.info-header h2 {
    font-size: 1rem;
    color: var(--brand-green);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s;
}

.info-section.collapsed .info-content {
    display: none;
}

.info-section.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.info-content {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.usage-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.usage-step {
    position: relative;
    padding-left: 2.5rem;
}

.usage-step::before {
    content: attr(data-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    background: var(--brand-green);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.disclaimer {
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px dashed var(--border-color);
    padding-top: 1rem;
}

/* Cards */
.card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--brand-green);
    border-left: 4px solid var(--brand-orange);
    padding-left: 10px;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 3rem 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--brand-green);
    background-color: var(--accent-color);
}

.upload-icon {
    color: var(--brand-green);
    margin-bottom: 1rem;
}

.upload-icon svg {
    width: 48px;
    height: 48px;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Buttons */
.secondary-btn {
    background: white;
    border: 1px solid var(--brand-green);
    color: var(--brand-green);
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.secondary-btn:hover {
    background: var(--brand-green);
    color: white;
}

/* Progress */
.progress-container {
    margin-bottom: 1rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.progress-bar {
    height: 10px;
    background: #eee;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-green), #48bb78);
    transition: width 0.3s ease;
}

/* Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--brand-green);
}

/* Charts & Tables */
.chart-container-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1rem;
}

.bar-chart-container {
    margin-top: 10px;
}

.bar-row {
    margin-bottom: 10px;
}

.bar-label {
    font-size: 0.85rem;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.bar-outer {
    height: 12px;
    background: #f3f4f6;
    border-radius: 6px;
    overflow: hidden;
}

.bar-inner {
    height: 100%;
    background: var(--brand-green);
    border-radius: 6px;
}

/* Data Table */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.data-table th, .data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: #f9fafb;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 700;
}

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

.data-table td {
    font-size: 0.95rem;
}

/* Warning Card and Badges */
.warning-card {
    border: 2px solid #feb2b2;
    background-color: #fffaf0;
}

.warning-card h3 {
    color: #c53030;
    border-left-color: #c53030;
}

.badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.level-high {
    background-color: #fed7d7;
    color: #c53030;
    border: 1px solid #c53030;
}

.level-medium {
    background-color: #feebc8;
    color: #c05621;
    border: 1px solid #c05621;
}

.reason-cell {
    font-size: 0.85rem;
    color: #742a2a;
    line-height: 1.4;
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 640px) {
    .chart-container-grid {
        grid-template-columns: 1fr;
    }
}
