/* 
 * TORELU アプリケーション スタイルシート
 * FastAPI + HTML/CSS版
 */

/* ベーススタイル */
:root {
    --primary-color: #68B7C0;
    --primary-dark: #4E9CA5;
    --primary-light: #A2D6DC;
    --primary-gradient: linear-gradient(135deg, #68B7C0 0%, #4E9CA5 100%);
    --secondary-color: #F4A259;
    --success-color: #34D399;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #3B82F6;
    --light-color: #F1F5F9;
    --dark-color: #1E293B;
    --bg-color: #F8FAFC;
    --bg-light: #F1F5F9;
    --bg-lighter: #FFFFFF;
    --text-color: #1E293B;
    --text-muted: #64748B;
    --border-color: #CBD5E1;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-sm: 4px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --font-sans: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
}

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

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

button, .btn {
    cursor: pointer;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ナビゲーションバー */
.navbar {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    background-color: var(--bg-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-container {
    flex: 0 0 auto;
}

.logo-container a {
    display: block;
}

.logo-container img {
    transition: transform 0.3s ease;
}

.logo-container:hover img {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    flex: 1 1 auto;
    margin-left: 40px;
}

.nav-icon {
    margin-right: 8px;
    vertical-align: middle;
}

.nav-item {
    padding: 10px 15px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.nav-item:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-light);
    text-decoration: none;
}

.nav-item.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.nav-item.active .nav-icon {
    color: var(--primary-color);
}

.user-profile {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.user-name {
    margin-right: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.logout-btn {
    padding: 6px 12px;
    background-color: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.logout-btn:hover {
    background-color: var(--danger-color);
    color: white;
    text-decoration: none;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 5px;
    margin-left: 20px;
}

@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
    }
    
    .nav-links {
        flex-basis: 100%;
        margin-left: 0;
        margin-top: 15px;
        flex-direction: column;
        display: none;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-item {
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-item:last-child {
        border-bottom: none;
    }
    
    .user-profile {
        margin-left: auto;
    }
    
    .user-name span {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
}

/* ボタン */
.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    padding: 8px 16px;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: var(--border-radius);
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-primary {
    color: white;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    color: white;
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    text-decoration: none;
}

.btn-secondary {
    color: white;
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    color: white;
    background-color: #F29234;
    border-color: #F18A20;
    text-decoration: none;
}

.btn-success {
    color: white;
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-success:hover {
    color: white;
    background-color: #2DC08D;
    border-color: #29B583;
    text-decoration: none;
}

.btn-danger {
    color: white;
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-danger:hover {
    color: white;
    background-color: #E12D2D;
    border-color: #DF1F1F;
    text-decoration: none;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.875rem;
}

.btn-icon {
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* 認証フォーム */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f9fafb;
}

.auth-box {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo img {
    height: 70px;
    transition: transform 0.3s ease;
}

.auth-logo img:hover {
    transform: scale(1.05);
}

.auth-title {
    text-align: center;
    margin-bottom: 32px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.5rem;
}

.auth-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
    transition: color 0.3s ease;
}

.form-group:focus-within label {
    color: var(--primary-color);
}

.input-icon-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.form-group input {
    width: 100%;
    padding: 12px 16px 12px 46px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f8fafc;
}

.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 4px rgba(79, 187, 200, 0.15);
    background-color: white;
}

.form-group input:focus + .input-icon {
    color: var(--primary-color);
}

.form-group input::placeholder {
    color: #a0aec0;
}

.auth-submit {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 8px;
    background-image: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(104, 183, 192, 0.3);
}

.auth-links {
    text-align: center;
    margin-top: 24px;
    font-size: 0.95rem;
}

.auth-links a {
    display: inline-block;
    margin: 0 10px;
    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.auth-links a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.auth-links a:hover:after {
    width: 100%;
}

.auth-links a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

.auth-message {
    text-align: center;
    margin-bottom: 24px;
    padding: 14px;
    border-radius: 8px;
    animation: fadeIn 0.5s ease;
}

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

.auth-message.success {
    background-color: rgba(40, 167, 69, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.auth-message.error {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.temp-password {
    font-size: 1.2rem;
    font-weight: bold;
    padding: 16px;
    margin: 16px 0;
    background-color: #f0f7fa;
    border: 2px dashed #7fd1db;
    border-radius: 8px;
    text-align: center;
    color: var(--primary-dark);
    letter-spacing: 1px;
}

/* アラート */
.alert {
    padding: 14px 18px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
}

.alert-success {
    color: #065F46;
    background-color: #D1FAE5;
    border-color: #6EE7B7;
}

.alert-error, .alert-danger {
    color: #991B1B;
    background-color: #FEE2E2;
    border-color: #FECACA;
}

.alert-info {
    color: #1E40AF;
    background-color: #DBEAFE;
    border-color: #BFDBFE;
}

.alert-warning {
    color: #92400E;
    background-color: #FEF3C7;
    border-color: #FDE68A;
}

/* カード */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.card-body {
    padding: 20px;
}

/* ダッシュボード */
.dashboard-container {
    padding: 20px 0;
}

.section-title {
    margin-bottom: 30px;
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    position: relative;
    padding-bottom: 8px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.form-section {
    margin-bottom: 40px;
    position: relative;
}

.form-section h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    font-weight: 600;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    margin-right: 12px;
    font-size: 0.9rem;
    font-weight: 700;
}

.step-title {
    font-weight: 600;
}

.file-upload-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
}

.file-input {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.file-label {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(79, 187, 200, 0.2);
}

.file-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(79, 187, 200, 0.3);
}

.file-label:active {
    transform: translateY(0);
}

.file-icon {
    margin-right: 8px;
    color: white;
}

.file-name {
    margin-left: 16px;
    color: var(--text-muted);
    font-size: 0.95rem;
    background-color: var(--bg-light);
    padding: 6px 12px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.upload-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 10px;
    padding: 10px;
    background-color: rgba(79, 187, 200, 0.05);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-color);
    line-height: 1.5;
}

.info-items-container {
    margin-bottom: 24px;
}

.info-item {
    margin-bottom: 24px;
    padding: 24px;
    border-radius: var(--border-radius);
    background-color: var(--bg-light);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
}

.info-item:hover {
    box-shadow: var(--shadow-lg);
}

.info-item .row {
    margin-left: -12px;
    margin-right: -12px;
}

.info-item .col-md-4,
.info-item .col-md-8 {
    padding-left: 12px;
    padding-right: 12px;
}

.info-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.info-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 187, 200, 0.1);
}

.info-description {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    resize: vertical;
    min-height: 100px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.info-description:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 187, 200, 0.1);
}

/* フォームラベルのスタイリング強化 */
.form-label {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 8px;
    display: block;
}

.remove-item {
    position: absolute;
    top: 8px;
    right: 8px;
    color: var(--danger-color);
    background-color: transparent;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.remove-item:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

.btn-outline {
    color: var(--primary-color);
    background-color: transparent;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

.btn-outline-secondary {
    color: var(--secondary-color);
    background-color: transparent;
    border: 2px solid var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

.processing-status {
    margin: 30px 0;
}

.progress-container {
    margin: 0 auto;
}

.progress-bar {
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(79, 187, 200, 0.2);
}

.progress-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
    font-weight: 500;
}

.processing-actions {
    margin-top: 20px;
    text-align: center;
}

.result-section {
    margin-top: 30px;
}

.result-table {
    margin-bottom: 20px;
    overflow-x: auto;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* テーブルのスタイル */
.styled-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95em;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.styled-table .header-row {
    background-color: var(--primary-color);
    color: white;
    text-align: left;
}

.styled-table th,
.styled-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dddddd;
}

.styled-table th {
    font-weight: 600;
}

.styled-table .even-row {
    background-color: #f8f9fa;
}

.styled-table .odd-row {
    background-color: white;
}

.styled-table tbody tr:hover {
    background-color: #f1f1f1;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    max-width: 100%;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius);
}

/* 履歴ページ */
.history-container {
    padding: 20px 0;
}

.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-gap: 20px;
}

.history-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.history-card-header {
    padding: 16px;
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-card-title {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.history-card-date {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.history-card-content {
    padding: 16px;
}

.history-card-info {
    margin-bottom: 16px;
}

.info-label {
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--secondary-color);
}

.info-value {
    word-break: break-all;
}

.history-card-actions {
    display: flex;
    justify-content: space-between;
}

.history-card-details {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background-color: #f8f9fa;
}

.details-content {
    font-size: 0.9rem;
}

.details-content h4 {
    margin-top: 10px;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.details-content pre {
    background-color: white;
    padding: 8px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 12px;
}

.excel-preview {
    margin-top: 12px;
}

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

.empty-state {
    text-align: center;
    padding: 40px 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    color: #ccc;
}

.empty-state h3 {
    margin-bottom: 12px;
    color: var(--text-color);
}

.empty-state p {
    color: var(--secondary-color);
    margin-bottom: 20px;
}

/* プロフィールページ */
.profile-container {
    padding: 20px 0;
}

.profile-content {
    display: grid;
    grid-template-columns: 1fr;
    grid-gap: 24px;
}

@media (min-width: 768px) {
    .profile-content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .profile-content > :first-child {
        grid-column: span 2;
    }
}

.profile-form,
.password-form {
    max-width: 500px;
}

.form-actions {
    margin-top: 24px;
}

.subscription-info {
    margin-bottom: 20px;
}

.subscription-plan {
    margin-bottom: 24px;
}

.subscription-plan h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
}

.plan-details {
    background-color: #f8f9fa;
    padding: 16px;
    border-radius: var(--border-radius);
}

.plan-feature {
    display: flex;
    margin-bottom: 8px;
}

.feature-label {
    font-weight: 500;
    margin-right: 10px;
    min-width: 120px;
}

.usage-info {
    margin-bottom: 24px;
}

.usage-info h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
}

.usage-progress {
    margin-bottom: 16px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.subscription-actions {
    margin-top: 24px;
}

.no-subscription {
    text-align: center;
    padding: 20px;
}

/* 料金プランページ */
.pricing-container {
    padding: 20px 0;
}

.pricing-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-gap: 24px;
    margin-bottom: 40px;
}

.pricing-plan {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.pricing-plan:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.pricing-plan.featured {
    border: 2px solid var(--primary-color);
    position: relative;
}

.pricing-plan.featured::before {
    content: 'おすすめ';
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--primary-color);
    color: white;
    padding: 4px 12px;
    font-size: 0.8rem;
    border-bottom-left-radius: 8px;
}

.plan-header {
    padding: 24px;
    text-align: center;
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
}

.plan-name {
    margin-bottom: 12px;
    color: var(--primary-color);
}

.plan-price {
    font-size: 2rem;
    font-weight: 600;
}

.price-period {
    font-size: 1rem;
    font-weight: normal;
    color: var(--secondary-color);
}

.plan-features {
    padding: 24px;
}

.plan-feature {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.feature-icon {
    color: var(--success-color);
    margin-right: 10px;
    font-weight: bold;
}

.plan-action {
    padding: 0 24px 24px;
    text-align: center;
}

.pricing-faq {
    max-width: 800px;
    margin: 0 auto;
}

.pricing-faq h2 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--primary-color);
}

.faq-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.faq-question {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-color);
    cursor: pointer;
}

.faq-answer {
    color: var(--secondary-color);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
    }
    
    .logo-container {
        flex: 0 0 100%;
        text-align: center;
        margin-bottom: 12px;
    }
    
    .nav-links {
        margin-left: 0;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .user-profile {
        flex: 0 0 100%;
        justify-content: center;
        margin-top: 12px;
    }
    
    .history-list {
        grid-template-columns: 1fr;
    }
}