/* styles.css - eSIM 管理系統樣式表 */

/* 基本樣式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "微軟正黑體", "Microsoft JhengHei", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* 標題樣式 */
h1, h2, h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 700;
}

h1 {
    font-size: 28px;
    border-bottom: 2px solid #e1e1e1;
    padding-bottom: 10px;
    margin-bottom: 25px;
}

h2 {
    font-size: 24px;
    margin: 25px 0 15px;
}

h3 {
    font-size: 20px;
    margin-bottom: 15px;
}

p {
    margin-bottom: 15px;
}

/* 表單樣式 */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

input[type="text"],
input[type="password"],
input[type="email"],
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

input[type="file"] {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 按鈕樣式 */
.btn {
    display: inline-block;
    padding: 10px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.3s, transform 0.1s;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

button {
    cursor: pointer;
    font-family: inherit;
}

/* 訊息樣式 */
.success {
    background-color: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid #28a745;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid #dc3545;
}

.info {
    background-color: #d1ecf1;
    color: #0c5460;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid #17a2b8;
}

/* 頁首樣式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
}

/* 行動按鈕區域 */
.actions {
    margin: 20px 0;
}

/* 登入表單樣式 */
.login-form {
    max-width: 400px;
    margin: 0 auto;
    padding: 25px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 旅程卡片樣式 */
.trips-list, .members-list {
    margin-top: 20px;
}

.trip-card, .member-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.trip-card:hover, .member-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.trip-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.trip-info, .member-info {
    flex: 1;
    min-width: 250px;
}

.trip-actions, .member-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 200px;
}

/* 分享連結樣式 */
.share-link {
    display: flex;
    margin-top: 10px;
    margin-bottom: 10px;
}

.share-link input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
}

.share-link button {
    padding: 8px 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

.share-link button:hover {
    background-color: #2980b9;
}

.share-section {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #3498db;
}

/* 成員資訊樣式 */
.member-data {
    margin: 15px 0;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
}

.esim-thumbnail {
    max-width: 100px;
    max-height: 100px;
    border: 1px solid #ddd;
    border-radius: 4px;
    object-fit: cover;
}

.not-set {
    color: #999;
    font-style: italic;
}

/* 成員鏈接列表 */
.members-links {
    margin-top: 30px;
}

.member-link {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.member-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.member-link a {
    text-decoration: none;
    color: #3498db;
    font-size: 18px;
    font-weight: bold;
    display: block;
    padding: 10px;
    transition: color 0.3s;
}

.member-link a:hover {
    color: #2980b9;
}

/* 密碼驗證表單 */
.password-form {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 25px;
    margin: 20px 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* eSIM 數據顯示 */
.esim-data {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 25px;
    margin: 20px 0;
}

.instruction {
    background-color: #f0f8ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
}

.esim-image {
    text-align: center;
    margin: 30px 0;
}

.esim-image img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.no-image {
    text-align: center;
    padding: 30px;
    background-color: #f5f5f5;
    border-radius: 8px;
    margin: 20px 0;
    color: #777;
}

.esim-details table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
}

.esim-details th, .esim-details td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.esim-details th {
    width: 30%;
    font-weight: bold;
    background-color: #f9f9f9;
}

.esim-details tr:last-child th,
.esim-details tr:last-child td {
    border-bottom: none;
}

.esim-details button {
    padding: 6px 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.esim-details button:hover {
    background-color: #2980b9;
}

.back-link {
    display: inline-block;
    margin-top: 15px;
    color: #3498db;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .trip-card {
        flex-direction: column;
    }
    
    .trip-info, .trip-actions {
        width: 100%;
    }
    
    .trip-actions {
        margin-top: 15px;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        margin-top: 15px;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        margin-right: 0;
    }
    
    .share-link {
        flex-direction: column;
    }
    
    .share-link input {
        border-radius: 4px;
        margin-bottom: 5px;
    }
    
    .share-link button {
        border-radius: 4px;
    }
    
    .esim-details th {
        width: 40%;
    }
}

/* 動畫效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.trip-card, .member-card, .member-link, .esim-data, .password-form {
    animation: fadeIn 0.3s ease-out forwards;
}