/**
 * DataBridge - Professional UI/UX Design
 * Modern glass-morphism with gradient theme
 */

/* ========================================
   リセット・基本設定
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Primary gradient */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-danger: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);

    /* Colors */
    --primary-color: #667eea;
    --primary-light: #8b9ff0;
    --accent-color: #f093fb;
    --success-color: #38ef7d;
    --danger-color: #f45c43;
    --warning-color: #ffc107;

    /* Card backgrounds */
    --card-bg: #ffffff;

    /* Borders - 統一 */
    --border-color: #d1d5db;
    --border-light: #e5e7eb;

    /* Text */
    --text-dark: #1a1a2e;
    --text-muted: #6c757d;
    --text-light: #ffffff;

    /* Misc */
    --border-radius: 16px;
    --border-radius-sm: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: var(--text-dark);
    line-height: 1.6;
}

/* ========================================
   ボタン - Modern Design
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:disabled::before {
    display: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-light);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #7b8fee 0%, #8a5cb0 100%);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-light);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
}

.btn-danger {
    background: var(--gradient-danger);
    color: var(--text-light);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--glass-bg-solid);
    border: 2px solid #e2e8f0;
    color: var(--text-dark);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 8px;
}

.btn-large {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    border-radius: 12px;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-url {
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
    color: white;
    box-shadow: none;
}

.btn-url:hover:not(:disabled) {
    background: linear-gradient(135deg, #33d4ff 0%, #3399ff 100%);
}

/* 操作ボタン - サイズ統一・シンプルなホバー効果 */
.col-actions .btn-small {
    width: 56px;
    height: 28px;
    padding: 0;
    box-shadow: none;
    font-size: 0.75rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.col-actions .btn-small::before {
    display: none;
}

.col-actions .btn-small:hover:not(:disabled) {
    transform: none;
    box-shadow: none;
}

.col-actions .btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #f04d5e 0%, #f67a5a 100%);
}

/* ========================================
   フォーム - Modern Design
======================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.checkbox-label:hover {
    background: #f1f5f9;
}

.checkbox-label input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--primary-color);
}

/* ========================================
   ログインページ
======================================== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* ========================================
   ヘッダー - Glass Effect
======================================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: -0.5px;
}

/* ========================================
   メインコンテンツ
======================================== */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ========================================
   アップロードセクション - Card
======================================== */
.upload-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.upload-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.step {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
}

.step:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.step-number {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 4rem;
    padding: 0.375rem 0.75rem;
    background: var(--gradient-primary);
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.step-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.step-content {
    padding-left: 5rem;
}

.file-select-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.file-select-buttons .btn-outline {
    padding: 1rem 1.5rem;
    border-style: dashed;
    border-width: 2px;
}

.file-select-buttons .btn-outline:hover {
    border-style: solid;
}

.selected-files {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--border-radius-sm);
    max-height: 150px;
    overflow-y: auto;
}

.selected-files:empty {
    display: none;
}

.selected-files .file-item {
    padding: 0.375rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* プログレスバー - Modern */
.upload-progress {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

#progressText {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 3rem;
}

/* ========================================
   ファイル一覧セクション - Card
======================================== */
.file-list-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.file-list-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-count {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.file-list-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.search-input {
    width: 200px;
    height: 38px;
    padding: 0 1rem;
    font-size: 0.875rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: var(--transition);
    box-sizing: border-box;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 検索ボタン - コントラスト改善 */
.search-form .btn-small {
    height: 38px;
    min-width: 60px;
    padding: 0 1rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    white-space: nowrap;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    box-sizing: border-box;
}

.search-form .btn-small:hover {
    background: var(--primary-light);
}

/* 共通プルダウンスタイル */
.select-styled {
    height: 38px;
    padding: 0 2.5rem 0 1rem;
    font-size: 0.875rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.select-styled:focus {
    border-color: var(--primary-color);
    outline: none;
}

.sort-select {
    height: 38px;
    padding: 0 2.5rem 0 1rem;
    font-size: 0.875rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.sort-select:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* ファイルテーブル - Modern */
.file-table-wrapper {
    max-height: 550px;
    overflow-y: auto;
}

.file-table-wrapper::-webkit-scrollbar {
    width: 8px;
}

.file-table-wrapper::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.file-table-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.file-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

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

.file-table th,
.file-table td {
    padding: 0.75rem 1.5rem;
    text-align: left;
}

.file-table th {
    background: #f8f9fa;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
}

.file-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.file-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.file-table tbody tr:last-child {
    border-bottom: none;
}

.col-name {
    width: 45%;
    text-align: left;
}

.col-size {
    width: 10%;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

.col-date {
    width: 18%;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

.col-dl {
    width: 7%;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

.col-actions {
    width: 15%;
    white-space: nowrap;
    text-align: center;
}

.col-actions .btn {
    margin-left: 0.5rem;
}

.col-actions .btn:first-child {
    margin-left: 0;
}

.file-icon {
    font-size: 1.25rem;
    margin-left: 1.5rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.lock-icon {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-right: 0.25rem;
}

.file-name {
    font-weight: 500;
    word-break: break-all;
    color: var(--text-dark);
}

.empty-message {
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
}

.empty-message::before {
    content: '📁';
    display: block;
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ページネーション - Modern */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.pagination .btn {
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: 8px;
}

.pagination .btn-primary {
    box-shadow: none;
}

.pagination-dots {
    padding: 0 0.5rem;
    color: var(--text-muted);
}

/* ========================================
   モーダル - Glass Effect
======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal[hidden] {
    display: none;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 480px;
    margin: 1rem;
    animation: slideUp 0.3s ease;
}

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

.modal-content h3 {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.copy-field {
    display: flex;
    gap: 0.5rem;
}

.copy-field input {
    flex: 1;
    background: #f8fafc;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.875rem;
}

.download-btn-wrap {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

/* モーダル内のボタン（シンプルなホバーのみ） */
.modal-content .btn {
    box-shadow: none;
}

.modal-content .btn::before {
    display: none;
}

.modal-content .btn:hover:not(:disabled) {
    transform: none;
    box-shadow: none;
    background: linear-gradient(135deg, #7b8fee 0%, #8a5cb0 100%);
}

.modal-content .btn-secondary {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

/* ========================================
   ダウンロードページ（クライアント用）
======================================== */
.download-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

.download-container {
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.download-container h1 {
    margin-bottom: 2rem;
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.download-box,
.auth-box,
.error-box {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
}

.file-info {
    margin-bottom: 2rem;
}

.file-icon-large {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

.file-info h2 {
    font-size: 1.25rem;
    font-weight: 700;
    word-break: break-all;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.file-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-box h2 {
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.auth-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.auth-box .form-group {
    text-align: left;
}

.error-box {
    border-left: 4px solid var(--danger-color);
}

.error-box h2 {
    color: var(--danger-color);
    margin-bottom: 0.5rem;
}

/* ========================================
   メッセージ - Modern
======================================== */
.error-message {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.success-message {
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    border: 1px solid #9ae6b4;
    color: #276749;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ========================================
   アニメーション
======================================== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ========================================
   レスポンシブ
======================================== */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .header h1 {
        font-size: 1.25rem;
    }

    .main-content {
        padding: 1rem;
    }

    .upload-section {
        padding: 1.5rem;
    }

    .step-content {
        padding-left: 0;
        margin-top: 1rem;
    }

    .step-header {
        flex-wrap: wrap;
    }

    .file-select-buttons {
        flex-direction: column;
    }

    .file-select-buttons .btn {
        width: 100%;
    }

    .file-list-header {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }

    .file-list-controls {
        flex-direction: column;
    }

    .search-form {
        width: 100%;
        flex-wrap: wrap;
    }

    .search-input {
        flex: 1;
        width: auto;
        min-width: 150px;
    }

    .sort-select {
        width: 100%;
    }

    .file-table-wrapper {
        overflow-x: auto;
    }

    .file-table {
        min-width: 650px;
    }

    .file-table th,
    .file-table td {
        padding: 0.75rem 1rem;
    }

    .modal-content {
        margin: 0.5rem;
        max-width: none;
    }

    .pagination {
        flex-wrap: wrap;
    }
}

/* ========================================
   ダークモードサポート（オプション）
======================================== */
@media (prefers-color-scheme: dark) {
    .login-container,
    .upload-section,
    .file-list-section,
    .download-box,
    .auth-box,
    .modal-content {
        /* Keep light theme for cards even in dark mode for better readability */
    }
}

/* ========================================
   招待URL機能
======================================== */
.invite-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 2rem;
    margin-bottom: 2rem;
}

.invite-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.invite-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.invite-form .form-group {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0;
}

/* 招待URL発行ボタン - シンプルなホバー効果のみ */
.invite-form .btn-primary {
    height: 46px;
    box-shadow: none;
    transform: none;
    flex-shrink: 0;
}

.invite-form .btn-primary::before {
    display: none;
}

.invite-form .btn-primary:hover:not(:disabled) {
    transform: none;
    box-shadow: none;
    background: linear-gradient(135deg, #7b8fee 0%, #8a5cb0 100%);
}

.invite-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.invite-form select,
.invite-form input[type="text"] {
    width: 100%;
    height: 46px;
    padding: 0 1rem;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: white;
    transition: var(--transition);
}

.invite-form select:focus,
.invite-form input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.invite-list {
    margin-top: 1.5rem;
}

.invite-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.invite-list-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
}

.invite-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.invite-item .invite-info {
    flex: 1;
    min-width: 200px;
}

.invite-item .invite-url {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--primary-color);
    word-break: break-all;
}

.invite-item .invite-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.invite-item .invite-memo {
    font-size: 0.85rem;
    color: var(--text-dark);
    font-weight: 500;
}

.invite-item .invite-remaining {
    background: var(--gradient-success);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.invite-item .invite-remaining.expiring-soon {
    background: var(--gradient-danger);
}

.invite-item .invite-actions {
    display: flex;
    gap: 0.5rem;
}

.invite-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 招待URLモーダル */
.invite-result {
    text-align: center;
    padding: 1rem 0;
}

.invite-result .invite-url-display {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    margin: 1rem 0;
    word-break: break-all;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.invite-result .btn {
    margin-top: 0.5rem;
}

.invite-result .invite-expiry {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* タブ切り替え */
.section-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.section-tab {
    padding: 0.75rem 1.5rem;
    background: #e9ecef;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    margin-bottom: -2px;
}

.section-tab:hover {
    background: #dee2e6;
    color: #212529;
}

.section-tab.active {
    background: white;
    color: var(--primary-color);
    border-color: var(--border-color);
    border-bottom: 2px solid white;
    font-weight: 600;
}

.section-tab.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 8px 8px 0 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========================================
   クリーンアップ機能
======================================== */
.cleanup-section {
    padding: 1rem 0;
}

.cleanup-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.cleanup-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.orphaned-list {
    margin-top: 1rem;
}

.orphaned-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.5rem;
    border: 1px solid #e9ecef;
}

.orphaned-item:hover {
    background: #f1f3f4;
}

.orphaned-info {
    flex: 1;
    min-width: 0;
}

.orphaned-id {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--primary-color);
    word-break: break-all;
    margin-bottom: 0.25rem;
}

.orphaned-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.orphaned-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.orphaned-error {
    text-align: center;
    padding: 1rem;
    color: var(--danger-color);
    background: #fff5f5;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
}

/* クリーンアップタブ内のボタンから影を削除 */
.cleanup-section .btn {
    box-shadow: none;
}

.cleanup-section .btn::before {
    display: none;
}

.cleanup-section .btn:hover:not(:disabled) {
    transform: none;
    box-shadow: none;
}

.orphaned-item .btn {
    box-shadow: none;
}

.orphaned-item .btn::before {
    display: none;
}

.orphaned-item .btn:hover:not(:disabled) {
    transform: none;
    box-shadow: none;
}

/* ========================================
   アップロードオプション設定
======================================== */
.option-group {
    margin-bottom: 1rem;
}

.option-row {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.option-group-wide {
    flex: 1;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.option-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 400;
    margin-left: 4px;
}

.option-select {
    height: 38px;
    padding: 0 2.5rem 0 1rem;
    font-size: 0.875rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.option-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.option-input {
    width: 100%;
    height: 38px;
    padding: 0 1rem;
    font-size: 0.875rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: var(--transition);
}

.option-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ファイル一覧のアイコン */
.expiry-icon {
    display: inline-flex;
    align-items: center;
    margin-right: 4px;
}

.file-memo-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    color: var(--text-muted);
    cursor: help;
}

.file-memo-badge:hover {
    color: var(--primary-color);
}

/* ========================================
   Dashboard Info Bar
======================================== */
.dashboard-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    flex-wrap: wrap;
    gap: 1rem;
}

.last-login-info {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.storage-usage {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.storage-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.storage-bar {
    width: 150px;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.storage-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.storage-bar-fill.storage-warning {
    background: linear-gradient(135deg, #f0ad4e 0%, #ff8c00 100%);
}

.storage-bar-fill.storage-critical {
    background: var(--gradient-danger);
}

/* ========================================
   Login History Table
======================================== */
.login-history-section h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.login-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.login-history-table th,
.login-history-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.login-history-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.login-history-table .ua-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========================================
   Logo
======================================== */
.site-logo {
    max-height: 40px;
    width: auto;
    vertical-align: middle;
}

.login-container .site-logo,
.download-container .site-logo,
.guest-header .site-logo {
    max-height: 60px;
}

/* Logo Settings */
.settings-section h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.settings-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.logo-preview {
    margin: 1.5rem 0;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: var(--border-radius-sm);
    text-align: center;
    border: 2px dashed var(--border-color);
}

.logo-preview .logo-img {
    max-height: 80px;
    max-width: 300px;
}

.logo-placeholder {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.logo-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.settings-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .option-row {
        flex-direction: column;
        gap: 1rem;
    }

    .dashboard-info-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .login-history-table .ua-cell {
        max-width: 150px;
    }
}
