/* 基本樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 15px;
}

/* 卡片樣式 */
.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 標題樣式 */
h1 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

h2 {
    font-size: 20px;
    color: #34495e;
    margin-bottom: 15px;
}

h3 {
    font-size: 18px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

/* 表單樣式 */
.form-group {
    margin-bottom: 15px;
}

input[type="text"],
input[type="number"],
.select-field {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    background-color: white;
}

.select-field {
    cursor: pointer;
}

button {
    background-color: #3498db;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

/* 複選框組樣式 */
.checkbox-group {
    margin: 15px 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f8f9fa;
}

.checkbox-label {
    display: block;
    margin: 8px 0;
    font-size: 14px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
}

/* 列表樣式 */
.list {
    margin-top: 10px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.list-item:last-child {
    border-bottom: none;
}

/* 按鈕組樣式 */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.button {
    flex: 1;
    display: block;
    background-color: #2ecc71;
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.button:hover {
    background-color: #27ae60;
}

/* 刪除按鈕樣式 */
.delete-btn {
    background-color: #e74c3c;
    padding: 5px 10px;
    font-size: 14px;
}

.delete-btn:hover {
    background-color: #c0392b;
}

/* 編輯按鈕樣式 */
.edit-btn {
    background-color: #f39c12;
    padding: 5px 10px;
    font-size: 14px;
}

.edit-btn:hover {
    background-color: #d68910;
}

/* 區段樣式 */
.section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

/* 消費記錄樣式 */
.expense-item {
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 15px;
    padding: 15px;
    background-color: white;
}

.expense-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.expense-amount {
    font-size: 18px;
    font-weight: bold;
    color: #2ecc71;
}

.expense-details {
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.expense-actions {
    display: flex;
    gap: 10px;
}

.edit-form {
    margin-top: 15px;
    padding: 15px;
    border-top: 1px solid #ddd;
}

/* 分帳結果樣式 */
.settlement-section {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}

.settlement-section.total {
    background-color: #e8f5e9;
    border-color: #c8e6c9;
}

.settlement-list {
    margin-top: 10px;
}

.settlement-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    font-size: 16px;
}

.member-name {
    font-weight: 500;
    color: #2c3e50;
}

.arrow {
    margin: 0 10px;
    color: #95a5a6;
}

.amount {
    margin-left: auto;
    font-weight: bold;
    color: #e67e22;
}

/* 行程卡片網格 */
.trips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.trip-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.trip-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.trip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.trip-date {
    color: #666;
    font-size: 14px;
}

.trip-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.stat-item {
    flex: 1;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #666;
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #2ecc71;
}

/* 選單網格 */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.menu-card {
    height: 100%;
}

.button-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.menu-button {
    display: block;
    padding: 15px;
    text-align: center;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.menu-button:hover {
    background-color: #2980b9;
}

.menu-button.primary {
    background-color: #2ecc71;
}

.menu-button.primary:hover {
    background-color: #27ae60;
}

.primary-btn {
    background-color: #2ecc71;
}

.primary-btn:hover {
    background-color: #27ae60;
}

/* 大按鈕樣式 */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.big-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px;
    text-decoration: none;
    color: white;
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 1.3em;
    text-align: center;
}

.big-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.big-button.primary {
    background-color: #2ecc71;
}

.big-button.primary:hover {
    background-color: #27ae60;
}

.big-button.secondary {
    background-color: #3498db;
}

.big-button.secondary:hover {
    background-color: #2980b9;
}

.button-icon {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: #666;
    font-size: 1.2em;
}

/* 分享代碼樣式 */
.access-code-display {
    margin-top: 15px;
    padding: 12px;
    background-color: #f0f0f0;
    border-radius: 5px;
    text-align: center;
    font-size: 1em;
    border: 1px dashed #ccc;
}

.access-code-display strong {
    font-family: monospace;
    font-size: 1.2em;
    background-color: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    color: #e74c3c;
}

/* 響應式設計 */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .card {
        padding: 15px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    h3 {
        font-size: 16px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .expense-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .expense-amount {
        margin-top: 5px;
    }
    
    .settlement-item {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .amount {
        width: 100%;
        text-align: right;
        margin-top: 5px;
    }
}

/* 動畫效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.3s ease-out;
}