/* リセットとベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6C5CE7;
    --secondary-color: #A29BFE;
    --success-color: #00B894;
    --warning-color: #FDCB6E;
    --danger-color: #FF7675;
    --dark-bg: #2D3436;
    --light-bg: #F5F6FA;
    --card-bg: #FFFFFF;
    --text-primary: #2D3436;
    --text-secondary: #636E72;
    --border-color: #DFE6E9;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--light-bg);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* 画面管理 */
.screen {
    display: none;
    min-height: 100vh;
    width: 100%;
}

.screen.active {
    display: block;
}

/* ウェルカム画面 */
#welcome-screen {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.welcome-container {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
}

.logo {
    font-size: 5rem;
    margin-bottom: 2rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.welcome-container h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.version {
    font-size: 0.9rem;
    opacity: 0.8;
}

.tagline {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 3rem;
    line-height: 1.6;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* 役割選択画面 */
#role-screen {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.role-container {
    text-align: center;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    color: white;
}

.role-container h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 3rem;
}

.role-cards {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.role-card {
    background: white;
    color: var(--primary-color);
    padding: 3rem 2rem;
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    min-width: 150px;
}

.role-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.role-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.role-card h3 {
    font-size: 1.3rem;
}

/* PINコード画面 */
#pin-screen {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-container {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    color: white;
    position: relative;
}

.back-button {
    position: absolute;
    top: 2rem;
    left: 2rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pin-container h2 {
    margin-bottom: 3rem;
    font-size: 1.5rem;
}

.pin-dots {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.dot {
    width: 15px;
    height: 15px;
    border: 2px solid white;
    border-radius: 50%;
    transition: background 0.3s;
}

.dot.filled {
    background: white;
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 300px;
    margin: 0 auto;
}

.pin-keypad button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    width: 70px;
    height: 70px;
}

.pin-keypad button:hover:not(.empty) {
    background: rgba(255, 255, 255, 0.3);
}

.pin-keypad button.empty {
    background: transparent;
    cursor: default;
}

/* ダッシュボード画面 */
#dashboard-screen {
    padding-bottom: 80px;
}

.app-header {
    background: white;
    padding: 0.5rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.time {
    font-weight: 600;
    font-size: 0.9rem;
}

.status-icons {
    display: flex;
    gap: 0.5rem;
    font-size: 0.9rem;
}

/* スタッフ情報 */
.staff-info {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 2rem 1.5rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.greeting h2 {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.greeting h3 {
    font-size: 1.2rem;
    opacity: 0.9;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

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

/* ウォレットカード */
.wallet-card {
    background: white;
    margin: -2rem 1.5rem 1.5rem;
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.wallet-balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.wallet-balance .amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.wallet-balance .amount-fiat {
    font-size: 1rem;
    color: var(--text-secondary);
}

.wallet-address {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: monospace;
}

/* 統計グリッド */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stat-period {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-title {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* チャートセクション */
.chart-section {
    background: white;
    margin: 0 1.5rem 2rem;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chart-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

#salesChart {
    max-height: 250px;
}

/* トランザクションセクション */
.transactions-section {
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    font-size: 1.2rem;
}

.section-header a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.transaction-list {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.transaction-list.full {
    margin: 1.5rem;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-item:hover {
    background: var(--light-bg);
}

.transaction-info {
    flex: 1;
}

.transaction-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.status-badge {
    padding: 0.2rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.completed {
    background: rgba(0, 184, 148, 0.1);
    color: var(--success-color);
}

.status-badge.processing {
    background: rgba(253, 203, 110, 0.1);
    color: var(--warning-color);
}

.status-badge.failed {
    background: rgba(255, 118, 117, 0.1);
    color: var(--danger-color);
}

.transaction-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.transaction-amount {
    text-align: right;
}

.amount-crypto {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.amount-fiat {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ナビゲーションバー */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 0.8rem 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    position: relative;
    transition: color 0.2s;
}

.nav-item i {
    font-size: 1.3rem;
}

.nav-item span {
    font-size: 0.75rem;
}

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

.nav-item .badge {
    position: absolute;
    top: 0;
    right: 0.5rem;
    background: var(--danger-color);
    color: white;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
}

/* 取引一覧画面 */
.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.page-header h2 {
    font-size: 1.5rem;
}

/* レスポンシブデザイン */
@media (max-width: 600px) {
    .role-cards {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .role-card {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.transaction-item {
    animation: fadeIn 0.3s ease-out;
}
