﻿/* ======================================
   全域樣式 - Rotary Club
   ====================================== */

/* ============ 基本設定 ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft JhengHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
    background-color: var(--gray-100);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============ 容器 ============ */
.body-content {
    margin-top: 15px;
    padding-left: 15px;
    padding-right: 15px;
}

.container {
    max-width: 1200px;
}

.container-fluid {
    padding-left: 0;
    padding-right: 0;
}

/* ============ 標題樣式 ============ */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: var(--font-size-4xl);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

h5 {
    font-size: var(--font-size-lg);
}

h6 {
    font-size: var(--font-size-base);
}

/* ============ 段落與文字 ============ */
p {
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: var(--transition-fast);
}

    a:hover {
        color: var(--primary-purple);
        text-decoration: underline;
    }

/* ============ 表單元素 ============ */
input,
select,
textarea {
    font-family: 'Microsoft JhengHei', sans-serif;
}

    /* 移除 Bootstrap 預設的最大寬度限制 */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="date"],
    select,
    textarea {
        max-width: 100%;
    }

.form-control {
    border: 2px solid #adb5bd !important;
    border-radius: 10px !important;
    padding: 0.75rem 1rem !important;
    transition: var(--transition-fast);
    font-size: 1rem;
    background-color: #fff;
}

    .form-control:focus {
        border-color: var(--primary-blue) !important;
        box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.15) !important;
        outline: none;
    }

.form-select {
    border: 2px solid #adb5bd !important;
    border-radius: 10px !important;
    padding: 0.75rem 2.5rem 0.75rem 1rem !important;
    transition: var(--transition-fast);
    font-size: 1rem;
    background-color: #fff;
    background-position: right 0.75rem center !important;
    background-size: 16px 12px !important;
}

    .form-select:focus {
        border-color: var(--primary-blue) !important;
        box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.15) !important;
    }

/* Select 下拉選單特殊樣式 */
select.form-select,
select.form-control {
    border: 2px solid #adb5bd !important;
    border-radius: 10px !important;
    padding: 0.75rem 2.5rem 0.75rem 1rem !important;
    background-color: #fff;
    background-position: right 0.75rem center !important;
    background-size: 16px 12px !important;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Textarea 特殊樣式 */
textarea.form-control {
    border: 2px solid #adb5bd !important;
    border-radius: 10px !important;
    padding: 0.75rem 1rem !important;
    min-height: 120px;
    resize: vertical;
    background-color: #fff;
}

/* Input 類型統一樣式 */
input[type="text"].form-control,
input[type="email"].form-control,
input[type="password"].form-control,
input[type="number"].form-control,
input[type="tel"].form-control,
input[type="url"].form-control,
input[type="date"].form-control,
input[type="file"].form-control {
    border: 2px solid #adb5bd !important;
    border-radius: 10px !important;
    padding: 0.75rem 1rem !important;
    background-color: #fff;
}

/* ============ 按鈕樣式增強 ============ */
/* 保留 Bootstrap 預設按鈕樣式，但添加增強效果 */

/* 所有按鈕的通用增強 */
.btn {
    border-radius: var(--border-radius-md);
    font-weight: var(--font-weight-semibold);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

    .btn::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.3);
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }

    .btn:hover::before {
        width: 300px;
        height: 300px;
    }

    .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

    .btn:active {
        transform: translateY(0);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

/* Primary 按鈕增強 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

    .btn-primary:hover {
        background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    }

/* Success 按鈕增強 */
.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
}

    .btn-success:hover {
        background: linear-gradient(135deg, #38ef7d 0%, #11998e 100%);
    }

/* Danger 按鈕增強 */
.btn-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
}

    .btn-danger:hover {
        background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    }

/* Warning 按鈕增強 */
.btn-warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    border: none;
    color: #fff;
}

    .btn-warning:hover {
        background: linear-gradient(135deg, #fee140 0%, #fa709a 100%);
        color: #fff;
    }

/* Info 按鈕增強 */
.btn-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
}

    .btn-info:hover {
        background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    }

/* Light 按鈕增強 */
.btn-light {
    background: white;
    border: 2px solid var(--gray-300);
    color: var(--gray-700);
}

    .btn-light:hover {
        background: var(--gray-100);
        border-color: var(--gray-400);
        color: var(--gray-900);
    }

/* Outline 按鈕增強 */
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-info {
    border-width: 2px;
    font-weight: var(--font-weight-semibold);
}

    .btn-outline-primary:hover,
    .btn-outline-secondary:hover,
    .btn-outline-success:hover,
    .btn-outline-danger:hover,
    .btn-outline-warning:hover,
    .btn-outline-info:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

/* 按鈕大小增強 */
.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 10px !important;
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
    border-radius: 8px !important;
}

/* 強制所有按鈕使用圓角 */
.btn,
a.btn,
button.btn {
    border-radius: 10px !important;
}

/* ============ 表單區塊樣式 ============ */
.form-section {
    background: white;
    padding: 2rem;
    border-radius: 15px !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.form-section-title {
    color: #667eea;
    font-weight: bold;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f0f0;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Checkbox 樣式 */
.form-check-input {
    border-radius: 6px !important;
    border: 2px solid #adb5bd !important;
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    background-color: #fff;
}

    .form-check-input:checked {
        background-color: var(--primary-blue) !important;
        border-color: var(--primary-blue) !important;
    }

.form-check-label {
    cursor: pointer;
    margin-left: 0.5rem;
}

/* 圖片預覽樣式 */
.photo-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-top: 1rem;
}

/* 提示文字樣式 */
.upload-hint {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

/* 頁面標題樣式 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

    .page-header h2 {
        margin-bottom: 0;
        color: var(--primary-blue);
    }

/* ============ 卡片樣式 ============ */
.card {
    border: 1px solid var(--border-color);
    border-radius: 15px !important;
    box-shadow: var(--shadow-sm);
    background: white;
    transition: var(--transition-base);
}

    .card:hover {
        box-shadow: var(--shadow-md);
    }

.card-header {
    background: var(--gray-100);
    border-bottom: var(--border-width) solid var(--border-color);
    padding: var(--spacing-md) var(--spacing-lg);
    font-weight: var(--font-weight-semibold);
    border-radius: 15px 15px 0 0 !important;
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    background: var(--gray-100);
    border-top: var(--border-width) solid var(--border-color);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 0 0 15px 15px !important;
}

/* ============ 表格樣式 ============ */
.table {
    background: white;
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

    .table thead th {
        background: var(--gradient-primary);
        color: var(--text-white);
        border: none;
        padding: var(--spacing-md);
        font-weight: var(--font-weight-semibold);
    }

    .table tbody tr {
        transition: var(--transition-fast);
    }

        .table tbody tr:hover {
            background: var(--gray-100);
        }

    .table tbody td {
        padding: var(--spacing-md);
        vertical-align: middle;
    }

/* ============ 提示訊息 ============ */
.alert {
    border-radius: var(--border-radius-lg);
    border: none;
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.alert-success {
    background: #d1e7dd;
    color: #0f5132;
}

.alert-danger {
    background: #f8d7da;
    color: #842029;
}

.alert-warning {
    background: #fff3cd;
    color: #664d03;
}

.alert-info {
    background: #cff4fc;
    color: #055160;
}

/* ============ Bootstrap 描述列表修正 ============ */
.dl-horizontal dt {
    white-space: normal;
}

/* ============ 工具類別 ============ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 {
    margin-top: var(--spacing-xs);
}

.mt-2 {
    margin-top: var(--spacing-sm);
}

.mt-3 {
    margin-top: var(--spacing-md);
}

.mt-4 {
    margin-top: var(--spacing-lg);
}

.mt-5 {
    margin-top: var(--spacing-xl);
}

.mb-1 {
    margin-bottom: var(--spacing-xs);
}

.mb-2 {
    margin-bottom: var(--spacing-sm);
}

.mb-3 {
    margin-bottom: var(--spacing-md);
}

.mb-4 {
    margin-bottom: var(--spacing-lg);
}

.mb-5 {
    margin-bottom: var(--spacing-xl);
}

.pt-1 {
    padding-top: var(--spacing-xs);
}

.pt-2 {
    padding-top: var(--spacing-sm);
}

.pt-3 {
    padding-top: var(--spacing-md);
}

.pt-4 {
    padding-top: var(--spacing-lg);
}

.pt-5 {
    padding-top: var(--spacing-xl);
}

.pb-1 {
    padding-bottom: var(--spacing-xs);
}

.pb-2 {
    padding-bottom: var(--spacing-sm);
}

.pb-3 {
    padding-bottom: var(--spacing-md);
}

.pb-4 {
    padding-bottom: var(--spacing-lg);
}

.pb-5 {
    padding-bottom: var(--spacing-xl);
}

/* ============ 圖片樣式 ============ */
img {
    max-width: 100%;
    height: auto;
}

.img-fluid {
    max-width: 100%;
    height: auto;
}

/* ============ Banner 首頁橫幅樣式 ============ */
/* Banner 容器 */
.banner-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

    /* 背景圖片 */
    .banner-container > img {
        width: 100%;
        height: auto;
        display: block;
    }

/* 圖片覆蓋層 - 使用絕對定位 */
.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: stretch;
}

/* 圖片 1 - 紅色框（左側，社團名稱） */
.image-item-1 {
    display: inline-flex;
    align-items: center;
    justify-content: left;
    padding-left: 2%;
}

    .image-item-1 img {
        max-width: 100%;
        max-height: 85%;
        width: auto;
        height: auto;
        object-fit: contain;
    }

/* 圖片 2 - 橘色框（中間，年度口號） */
.image-item-2 {
    display: inline-flex;
    align-items: center;
    justify-content: left;
    padding: 0%;
    padding-right: 3%; /* 增加右側間距 */
}

    .image-item-2 img {
        max-width: 100%;
        max-height: 85%;
        width: auto;
        height: auto;
        object-fit: contain;
    }

/* 圖片 3 - 黑色框（右側，社徽） */
.image-item-3 {
    display: inline-flex;
    align-items: center;
    justify-content: left;
    padding: 0%;
    gap: 0.5rem;
}

    .image-item-3 img {
        max-width: 100%;
        max-height: 80%;
        width: auto;
        height: auto;
        object-fit: contain;
    }

/* 扶輪社文字 - 電腦版使用標楷體 */
.rotary-text {
    font-family: "DFKai-SB", "標楷體", "KaiTi", serif;
    font-size: 2.5rem;
    font-weight: bold;
    color: #1D2089;
    writing-mode: horizontal-tb;
    letter-spacing: 0.2rem;
    line-height: 1.2;
    margin-left: 1rem;
    white-space: nowrap;
}

.img-thumbnail {
    border: var(--border-width-thick) solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-xs);
}

/* ============ 驗證訊息樣式 ============ */
.field-validation-error {
    color: var(--bs-danger);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-xs);
}

.validation-summary-errors {
    background: #f8d7da;
    color: #842029;
    border: var(--border-width) solid #f5c2c7;
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

    .validation-summary-errors ul {
        margin: 0;
        padding-left: 20px;
    }

.input-validation-error {
    border-color: var(--bs-danger) !important;
}

/* ============ 載入動畫 ============ */
.spinner {
    border: 4px solid var(--gray-300);
    border-top: 4px solid var(--primary-blue);
    border-radius: var(--border-radius-round);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

/* ============ 滾動條樣式 ============ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-200);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: var(--border-radius-md);
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--primary-purple);
    }

/* ============ 選取文字樣式 ============ */
::selection {
    background: var(--primary-blue);
    color: var(--text-white);
}

::-moz-selection {
    background: var(--primary-blue);
    color: var(--text-white);
}

/* ============ 列表標題區塊 ============ */
.list-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: black;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

    .list-header h2 {
        color: white;
    }

    .list-header p {
        color: rgba(255, 255, 255, 0.9);
    }

    .list-header .btn-light {
        margin-left: 0.5rem;
        border-radius: 10px !important;
    }

    .list-header .btn,
    .list-header a.btn,
    .list-header button.btn {
        border-radius: 10px !important;
    }

/* ============ 響應式工具 ============ */
/* 平板裝置 (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .image-item-1,
    .image-item-2,
    .image-item-3 {
        padding: 1.5%;
    }

        .image-item-1 img {
            max-width: 80%;
            max-height: 80%;
        }

        .image-item-2 img {
            max-width: 80%;
            max-height: 80%;
        }

        .image-item-3 img {
            max-width: 75%;
            max-height: 75%;
        }

    .rotary-text {
        font-family: "Noto Serif TC", "DFKai-SB", "標楷體", "KaiTi", serif;
        font-size: 2rem;
        font-weight: 900;
        letter-spacing: 0.15rem;
        margin-left: 0.8rem;
    }
}

/* 手機和小螢幕 */
@media (max-width: 768px) {
    body {
        font-size: var(--font-size-sm);
    }

    h1 {
        font-size: var(--font-size-3xl);
    }

    h2 {
        font-size: var(--font-size-2xl);
    }

    h3 {
        font-size: var(--font-size-xl);
    }

    .container {
        padding-left: var(--spacing-sm);
        padding-right: var(--spacing-sm);
    }

    /* Banner RWD - 維持水平排列 */
    .banner-container > img {
        min-height: 120px;
        object-fit: cover;
    }

    .image-item-1 {
        padding-left: 3%;
    }

    .image-item-2,
    .image-item-3 {
        padding: 1%;
    }

    .image-item-1 img {
        max-width: 90%;
        max-height: 90%;
    }

    .image-item-2 img {
        max-width: 90%;
        max-height: 90%;
    }

    .image-item-3 img {
        max-width: 50%;
        max-height: 50%;
    }

    .rotary-text {
        font-family: "Noto Serif TC", "DFKai-SB", "標楷體", "KaiTi", serif;
        font-size: 1.3rem;
        font-weight: 900;
        letter-spacing: 0.05rem;
        margin-left: 0.3rem;
    }

    /* 列表標題 RWD */
    .list-header {
        padding: 1.5rem 1rem;
        border-radius: 10px;
    }

        .list-header .d-flex {
            flex-direction: column !important;
            align-items: flex-start !important;
            gap: 1rem;
        }

        .list-header h2 {
            font-size: 1.5rem;
            margin-bottom: 0.5rem;
        }

        .list-header p {
            font-size: 0.875rem;
            margin-bottom: 0;
        }

        .list-header > .d-flex > div:last-child {
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .list-header .btn-light {
            width: 100%;
            margin-left: 0;
            margin-bottom: 0;
            text-align: center;
            font-size: 0.9rem;
            padding: 0.65rem 1rem;
        }

    /* 表單區塊 RWD */
    .form-section {
        padding: 1.5rem 1rem;
        border-radius: 12px !important;
    }

    .form-section-title {
        font-size: 1.1rem;
    }

    /* 頁面標題 RWD */
    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

        .page-header h2 {
            font-size: 1.5rem;
        }

        .page-header .btn {
            width: 100%;
        }

    /* 表單控制項 RWD */
    .form-control {
        font-size: 1rem;
        padding: 0.65rem 0.85rem !important;
    }

    .form-select {
        font-size: 1rem;
        padding: 0.65rem 2.5rem 0.65rem 0.85rem !important;
        background-position: right 0.65rem center !important;
        background-size: 14px 10px !important;
    }

    select.form-select,
    select.form-control {
        padding: 0.65rem 2.5rem 0.65rem 0.85rem !important;
        background-position: right 0.65rem center !important;
        background-size: 14px 10px !important;
    }

    textarea.form-control {
        font-size: 1rem;
    }

    /* 按鈕組 RWD */
    .d-grid.gap-2 {
        gap: 0.75rem !important;
    }

    .d-grid .btn {
        padding: 0.75rem 1rem !important;
        font-size: 1rem !important;
    }
}

/* 小型手機 (最大 480px) */
@media (max-width: 480px) {
    .banner-container > img {
        min-height: 100px;
    }

    .image-item-1 {
        padding-left: 2%;
    }

    .image-item-2 {
        padding: 0%;
    }

    .image-item-3 {
        padding-right: 12%;
    }

    .image-item-1 img {
        max-width: 95%;
        max-height: 95%;
    }

    .image-item-2 img {
        max-width: 70%;
        max-height: 70%;
    }

    .image-item-3 img {
        max-width: 45%;
        max-height: 45%;
    }

    .rotary-text {
        font-family: "Noto Serif TC", "DFKai-SB", "標楷體", "KaiTi", serif;
        font-size: 1rem;
        font-weight: 900;
        letter-spacing: 0.05rem;
        margin-left: 0.2rem;
    }
}

/* ============ 列印樣式 ============ */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white;
    }

    a {
        text-decoration: underline;
    }

    .card {
        box-shadow: none;
        border: var(--border-width) solid var(--gray-300);
    }
}
