* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

/* Main wrapper for each page */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

/* Ensure hidden pages don't interfere with layout */
.page-wrapper.hidden {
    display: none;
}

.container {
    width: 100%;
    margin: 0;
    padding: 0;
    flex: 1;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    flex: 1;
    background: white;
    width: 100%;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    max-width: 500px;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0 auto;
}

.login-title {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 40px;
    color: #333;
    border-bottom: 2px solid #e53e3e;
    padding-bottom: 15px;
}



.form-group {
    margin-bottom: 25px;
    text-align: left;
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 18px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #e53e3e;
}

.login-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 18px 30px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s;
    font-weight: bold;
    margin-top: 10px;
}

.login-btn:hover {
    background: #c53030;
}

.forgot-password {
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
    margin-top: 15px;
    display: inline-block;
}

/* Header Styles */
.header {
    background: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #e53e3e;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-item {
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s;
    color: #333;
    font-weight: 500;
}

.nav-item:hover, .nav-item.active {
    background: #e53e3e;
    color: white;
}

.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #c82333;
}

/* Main Content Styles */
.main-content {
    background: white;
    margin: 0;
    padding: 20px;
    border-radius: 0;
    box-shadow: none;
    min-height: calc(100vh - 200px);
    flex: 1;
}

.page-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
    color: #333;
    text-align: center;
    border-bottom: 2px solid #e53e3e;
    padding-bottom: 15px;
    margin-top: 0;
}

/* Event Cards */
.events-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.event-card {
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    background: white;
}

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

.event-card[style*="cursor: pointer"]:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    border-color: #e53e3e;
}

.event-image {
    width: 100%;
    height: 160px;
    background: linear-gradient(45deg, #e53e3e, #c53030);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
    overflow: hidden;
    position: relative;
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: white;
}

.event-info {
    padding: 20px;
}

.event-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.event-details {
    color: #666;
    margin-bottom: 15px;
}

.register-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    transition: background 0.3s;
}

.register-btn:hover {
    background: #c53030;
}

.registered-btn {
    background: #6c757d;
    cursor: not-allowed;
}

.register-btn-disabled {
    background: #d3d3d3;
    color: #888;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: not-allowed;
    width: 100%;
    font-size: 16px;
    transition: none;
}

.register-btn-disabled:hover {
    background: #d3d3d3;
    color: #888;
}

/* Records Table */
.records-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

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

.records-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.status-attended {
    color: #e53e3e;
    font-weight: bold;
}

.status-absent {
    color: #dc3545;
    font-weight: bold;
}

.status-late {
    color: #ffc107;
    font-weight: bold;
}

/* Status Badge Styles for 報名紀錄 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    min-width: 60px;
}

/* Line Group Button Styles */
.line-group-btn {
    background: #00c73c;
    color: white;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background-color 0.2s, transform 0.1s;
    white-space: nowrap;
    text-decoration: none;
    font-weight: 500;
}

.line-group-btn:hover {
    background-color: #00a632;
    transform: translateY(-1px);
}

/* Mobile Responsive Styles for Registration Records */
@media (max-width: 768px) {
    .mobile-hide {
        display: none !important;
    }
    
    .mobile-show {
        display: table-cell !important;
    }
    
    /* Table fixes for mobile */
    .table-container {
        overflow-x: hidden;
    }
    
    .records-table {
        width: 100%;
        table-layout: fixed;
    }
    
    /* Column widths for mobile view */
    .records-table th:nth-child(1), /* 活動日期 */
    .records-table td:nth-child(1) {
        width: 22%;
        font-size: 11px;
        word-break: break-word;
    }
    
    .records-table th:nth-child(2), /* 活動名稱 */
    .records-table td:nth-child(2) {
        width: 40%;
        font-size: 11px;
        word-break: break-word;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 0; /* Force text truncation */
    }
    
    .records-table th:nth-child(3), /* 狀態 */
    .records-table td:nth-child(3) {
        width: 15%;
        font-size: 10px;
    }
    
    .records-table th:nth-child(9), /* 獲得點數 */
    .records-table td:nth-child(9) {
        width: 12%;
        font-size: 11px;
    }
    
    .records-table th:nth-child(10), /* 詳細 */
    .records-table td:nth-child(10) {
        width: 11%;
    }
    
    .mobile-expand-btn {
        background: #e53e3e;
        color: white;
        border: none;
        font-size: 11px;
        cursor: pointer;
        padding: 4px 8px;
        border-radius: 4px;
        transition: background-color 0.2s;
        white-space: nowrap;
        width: 100%;
        max-width: 60px;
    }
    
    .mobile-expand-btn:hover {
        background-color: #c53030;
    }

    /* Line Group Button Styles */
    .line-group-btn {
        background: #00c73c;
        color: white;
        border: none;
        font-size: 12px;
        cursor: pointer;
        padding: 6px 12px;
        border-radius: 4px;
        transition: background-color 0.2s;
        white-space: nowrap;
        text-decoration: none;
    }
    
    .line-group-btn:hover {
        background-color: #00a632;
    }
    
    .mobile-line-btn {
        font-size: 11px;
        padding: 4px 8px;
        margin-left: 5px;
    }
    
    .mobile-details-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 10px 0;
    }
    
    .detail-item {
        padding: 8px 12px;
        background-color: white;
        border-radius: 6px;
        border: 1px solid #e0e0e0;
        font-size: 14px;
    }
    
    .detail-item strong {
        color: #555;
        display: block;
        margin-bottom: 4px;
    }
    
    /* Better padding for mobile */
    .records-table th,
    .records-table td {
        padding: 8px 4px !important;
        text-align: center;
        vertical-align: middle;
    }
    
    /* Status badge adjustments for mobile */
    .status-badge {
        font-size: 10px;
        padding: 2px 6px;
        min-width: auto;
    }
    
    /* Activity title truncation for mobile */
    .activity-title-mobile {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }
    
    /* Mobile details header */
    .mobile-details-header {
        border-bottom: 1px solid #ddd;
        padding-bottom: 10px;
        margin-bottom: 10px;
    }
    
    /* Improve mobile table responsiveness */
    .records-table {
        font-size: 11px;
    }
    
    /* Better button sizing for very small screens */
    @media (max-width: 375px) {
        .mobile-expand-btn {
            font-size: 9px;
            padding: 3px 6px;
        }
        
        .records-table th:nth-child(2),
        .records-table td:nth-child(2) {
            width: 38%;
            font-size: 10px;
        }
        
        .records-table th:nth-child(1),
        .records-table td:nth-child(1) {
            width: 24%;
            font-size: 10px;
        }
        
        .activity-title-mobile {
            font-size: 10px;
        }
    }
}

/* Desktop: Hide mobile-only elements */
@media (min-width: 769px) {
    .mobile-expand-header,
    .mobile-expand-cell,
    .mobile-details-row {
        display: none !important;
    }
    
    .mobile-hide {
        display: table-cell !important;
    }
}

/* Admin Event Status Styles */
.status-active {
    color: #2e7d32;
    background: #e8f5e8;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.status-inactive {
    color: #d32f2f;
    background: #ffebee;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.status-published {
    color: #1976d2;
    background: #e3f2fd;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.status-scheduled {
    color: #f57c00;
    background: #fff3e0;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
}

.status-pending {
    background: #ffeaa7;
    color: #d63031;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.status-attended {
    background: #cce5ff;
    color: #004085;
}

.status-confirmed {
    background: #e2e3e5;
    color: #383d41;
}

.stars {
    color: #ffd700;
}

/* Points Section */
.points-info {
    background: linear-gradient(45deg, #e53e3e, #c53030);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 30px;
}

.current-points {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 10px;
}

.points-period {
    font-size: 14px;
    opacity: 0.9;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.product-card {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.product-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(45deg, #e53e3e, #c53030);
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
    background: white;
}

.product-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

.product-points {
    color: #e53e3e;
    font-weight: bold;
    margin-bottom: 15px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #e53e3e;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-input {
    width: 50px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
}

.exchange-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.exchange-btn:hover {
    background: #c53030;
}

.exchange-btn-disabled {
    background: #d3d3d3;
    color: #888;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: not-allowed;
    transition: none;
}

.exchange-btn-disabled:hover {
    background: #d3d3d3;
    color: #888;
}

/* Product Detail Modal */
.product-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-detail-modal.hidden {
    display: none;
}

.product-detail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.product-detail-content {
    position: relative;
    width: 95%;
    max-width: 800px;
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out;
}

.product-detail-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.product-detail-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.close-product-detail {
    cursor: pointer;
    font-size: 28px;
    color: #999;
    line-height: 1;
}

.close-product-detail:hover {
    color: #666;
}

.product-detail-body {
    padding: 25px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

.product-detail-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    min-height: 300px;
}

.image-gallery {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.main-image {
    flex: 1;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.main-image img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.image-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 5px 0;
}

.thumbnail-item {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s;
}

.thumbnail-item.active {
    border-color: #e53e3e;
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-detail-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-detail-info h3 {
    margin: 0;
    font-size: 28px;
    color: #333;
    border-bottom: 2px solid #e53e3e;
    padding-bottom: 10px;
}

.product-detail-description h4,
.product-detail-sizes h4,
.product-detail-quantity h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #555;
}

.product-detail-description p {
    margin: 0;
    line-height: 1.6;
    color: #666;
}

.product-detail-points {
    font-size: 20px;
    color: #e53e3e;
    padding: 15px;
    background: #fff5f5;
    border-radius: 8px;
    border: 1px solid #fed7d7;
}

.product-detail-stock {
    font-size: 16px;
    color: #333;
}

.product-detail-attributes {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.product-detail-attribute {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-detail-attribute h4 {
    margin: 0;
    font-size: 18px;
    color: #555;
}

.product-detail-attribute select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.product-detail-quantity .quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-detail-quantity .qty-input {
    width: 80px;
    text-align: center;
}

.product-detail-actions {
    margin-top: 10px;
}

.product-detail-actions .exchange-btn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
}

/* Mobile Product Detail */
@media (max-width: 768px) {
    .product-detail-content {
        width: 98%;
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .product-detail-body {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .product-detail-image {
        min-height: 250px;
    }
    
    .product-detail-header h2 {
        font-size: 20px;
    }
    
    .product-detail-info h3 {
        font-size: 24px;
    }
    
    /* Enhanced quantity controls for product detail modal on mobile */
    .product-detail-quantity .quantity-controls {
        gap: 15px;
        margin: 25px 0;
        justify-content: center;
    }
    
    .product-detail-quantity .qty-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
        font-weight: bold;
        border-radius: 8px;
    }
    
    .product-detail-quantity .qty-input {
        width: 80px;
        height: 50px;
        font-size: 20px;
        font-weight: bold;
        padding: 12px;
        border-radius: 8px;
        border: 2px solid #ddd;
    }
}

/* Registration Form */
.registration-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-full {
    grid-column: 1 / -1 !important;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.form-group textarea {
    width: 540px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}

/* Larger textarea for content fields */
#newsContent {
    min-height: 200px;
}

.submit-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: #c53030;
}

.hidden {
    display: none;
}

/* Form Controls for Edit Mode */
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #e53e3e;
    box-shadow: 0 0 0 2px rgba(229, 62, 62, 0.1);
}

.form-control:required:invalid {
    border-color: #dc3545;
}

/* Address inputs container */
.address-inputs {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.address-inputs .form-control {
    flex: 1;
    min-width: 120px;
}

/* Header actions for user management */
.header-actions {
    display: flex;
    gap: 10px;
}

/* CSV Import Modal Styles */
.import-section {
    margin-bottom: 25px;
}

.csv-format {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
    border-left: 4px solid #e53e3e;
}

.csv-format code {
    display: block;
    background: none;
    font-size: 12px;
    line-height: 1.5;
    word-break: break-all;
}

.format-notes {
    margin-top: 15px;
}

.format-notes ul {
    margin: 0;
    padding-left: 20px;
}

.format-notes li {
    margin-bottom: 5px;
    font-size: 14px;
}

.file-upload-section {
    margin-bottom: 25px;
}

.file-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0.1px;
    height: 0.1px;
}

.file-input-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #e53e3e;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 14px;
}

.file-input-label:hover {
    background: #c73030;
}

.file-name {
    font-size: 14px;
    color: #666;
}

.preview-section {
    margin-bottom: 25px;
}

.preview-table-wrapper {
    max-height: 300px;
    overflow: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
}

.preview-table {
    margin: 0;
    font-size: 12px;
}

.preview-table th,
.preview-table td {
    padding: 8px;
    white-space: nowrap;
}

.preview-info {
    text-align: right;
    font-size: 14px;
    color: #666;
}

.import-results {
    margin-bottom: 25px;
}

.error-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
}

.error-item {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 8px 12px;
    margin-bottom: 5px;
    border-radius: 4px;
    font-size: 14px;
}

.success-summary {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 15px;
    border-radius: 4px;
    color: #155724;
}

.error-summary {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 4px;
    color: #721c24;
}

/* Sync notification styles */
.sync-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.sync-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.sync-notification-content {
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    min-width: 250px;
}

.sync-notification-content i {
    font-size: 16px;
}

/* Mobile responsive sync notification */
@media (max-width: 768px) {
    .sync-notification {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .sync-notification-content {
        min-width: auto;
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

/* Large modal for news details */
.modal-content.large-news-modal {
    max-width: 900px;
    width: 95%;
}

/* Large modal for event details */
.modal-content.large-event-modal {
    max-width: 900px;
    width: 95%;
}

.news-modal-image {
    width: 100%;
    height: 400px;
    background: linear-gradient(45deg, #e53e3e, #c53030);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.news-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.event-modal-image {
    width: 100%;
    height: 300px;
    background: linear-gradient(45deg, #e53e3e, #c53030);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.event-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: white;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

/* News Articles */
.news-article {
    border: 1px solid #ddd;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform 0.3s;
    display: flex;
    align-items: stretch;
}

.news-article:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.news-image {
    width: 350px;
    min-width: 350px;
    height: 250px;
    background: linear-gradient(45deg, #e53e3e, #c53030);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.news-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

/* Make featured news titles larger */
.news-title.featured {
    font-size: 24px;
    font-weight: 900;
    color: #e53e3e;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.news-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.read-more-btn {
    background: none;
    border: 2px solid #e53e3e;
    color: #e53e3e;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.read-more-btn:hover {
    background: #e53e3e;
    color: white;
}

.news-meta {
    color: #666;
    font-size: 14px;
    margin: 10px 0;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #666;
}

.empty-state p {
    font-size: 18px;
    margin: 0;
}

.stock-info {
    color: #666;
    font-size: 14px;
    margin: 5px 0;
}

/* Footer */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: auto;
    flex-shrink: 0;
    width: 100%;
}

.footer h3 {
    margin-bottom: 15px;
    color: #e53e3e;
}

.contact-info {
    line-height: 1.8;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Remove text selection highlighting */
.contact-info::selection {
    background: transparent;
}

.contact-info::-moz-selection {
    background: transparent;
}

/* Mobile Navigation Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: #e53e3e;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Mobile navigation */
    .mobile-menu-toggle {
        display: block;
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        gap: 0;
        z-index: 999;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-item {
        padding: 18px 20px;
        border-bottom: 1px solid #eee;
        margin: 0;
        border-radius: 0;
        min-height: 50px;
        display: flex;
        align-items: center;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .nav-container {
        flex-wrap: wrap;
        position: relative;
    }
    
    .logout-btn {
        margin-left: auto;
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Mobile content adjustments */
    .container {
        padding: 0;
    }
    
    .main-content {
        padding: 15px;
        margin: 0;
        flex: 1;
    }
    
    .page-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    /* Login page mobile */
    .login-container {
        padding: 15px;
        min-height: 100vh;
    }
    
    .login-box {
        padding: 20px;
        max-width: 100%;
        margin: 0;
        width: 100%;
        min-height: 100vh;
        justify-content: center;
    }
    
    .login-title {
        font-size: 28px;
        margin-bottom: 30px;
    }
    
    /* Form improvements for mobile */
    .form-group input,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 15px 12px;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .login-btn,
    .submit-btn,
    .register-btn,
    .exchange-btn,
    .exchange-btn-disabled {
        font-size: 16px;
        padding: 15px 20px;
        min-height: 44px; /* Touch-friendly button height */
        touch-action: manipulation; /* Prevents double-tap zoom */
        -webkit-tap-highlight-color: transparent;
    }
    
    .qty-btn,
    .read-more-btn {
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Cards and grids mobile */
    .events-grid,
    .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .event-card,
    .product-card {
        margin-bottom: 15px;
    }
    
    .event-image,
    .product-image {
        height: 150px;
        font-size: 16px;
    }
    
    .event-info,
    .product-card {
        padding: 15px;
    }
    
    /* Form rows mobile */
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .registration-form {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Table mobile responsiveness */
    .records-table {
        font-size: 14px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        border: 1px solid #ddd;
        border-radius: 8px;
    }
    
    .records-table th,
    .records-table td {
        padding: 12px 8px;
        min-width: 120px;
        white-space: nowrap;
    }
    
    .records-table tbody {
        display: table;
        width: 100%;
    }
    
    .records-table thead {
        display: table;
        width: 100%;
    }
    
    /* Exchange items table mobile optimization */
    .exchange-items-table {
        display: table !important;
        overflow-x: visible !important;
        white-space: normal !important;
        font-size: 13px;
    }
    
    .exchange-items-table th,
    .exchange-items-table td {
        white-space: normal !important;
        word-wrap: break-word;
        min-width: auto !important;
        vertical-align: top;
    }
    
    /* Specific column widths for exchange items table on mobile */
    .exchange-items-table th:nth-child(1), /* 品項 */
    .exchange-items-table td:nth-child(1) {
        width: 45%;
        text-align: left;
        padding: 10px 6px;
    }
    
    .exchange-items-table th:nth-child(2), /* 數量 */
    .exchange-items-table td:nth-child(2) {
        width: 15%;
        text-align: center;
        padding: 10px 4px;
    }
    
    .exchange-items-table th:nth-child(3), /* 單價 */
    .exchange-items-table td:nth-child(3) {
        width: 20%;
        text-align: center;
        padding: 10px 4px;
    }
    
    .exchange-items-table th:nth-child(4), /* 小計 */
    .exchange-items-table td:nth-child(4) {
        width: 20%;
        text-align: center;
        padding: 10px 4px;
    }
    
    /* Modal mobile improvements */
    .modal-content {
        margin: 10px;
        padding: 20px 15px;
        width: calc(100% - 20px);
        max-height: 90vh;
    }
    
    .modal-content.large-news-modal {
        width: calc(100% - 20px);
        max-width: none;
    }
    
    .modal-content.large-event-modal {
        width: calc(100% - 20px);
        max-width: none;
    }
    
    .news-modal-image {
        width: 100%;
        height: 280px;
        margin-bottom: 15px;
    }
    
    .event-modal-image {
        width: 100%;
        height: 220px;
        margin-bottom: 15px;
    }
    
    /* Points section mobile */
    .points-info {
        padding: 15px;
        text-align: center;
    }
    
    .current-points {
        font-size: 28px;
        margin-bottom: 8px;
    }
    
    .points-period {
        font-size: 13px;
    }
    
    /* Quantity controls mobile */
    .quantity-controls {
        gap: 15px;
        margin: 20px 0;
    }
    
    .qty-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
        font-weight: bold;
        border-radius: 8px;
    }
    
    .qty-input {
        width: 80px;
        height: 50px;
        font-size: 20px;
        font-weight: bold;
        padding: 12px;
        border-radius: 8px;
        border: 2px solid #ddd;
    }
    
    /* News articles mobile */
    .news-article {
        margin-bottom: 15px;
        flex-direction: column;
    }
    
    .news-image {
        width: 100%;
        min-width: auto;
        height: 180px;
        font-size: 16px;
    }
    
    .news-content {
        padding: 15px;
    }
    
    .news-title {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .news-excerpt {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 12px;
    }
    
    /* Footer mobile */
    .footer {
        padding: 20px 15px;
        font-size: 14px;
        margin-top: auto;
        flex-shrink: 0;
    }
    
    .contact-info {
        line-height: 1.6;
    }
    
    /* Shipping form mobile */
    #shippingForm .form-group {
        margin-bottom: 15px;
    }
    
    #shippingForm input,
    #shippingForm select {
        font-size: 16px;
        padding: 12px;
    }
    
    /* Profile info mobile */
    #infoPage div[style*="background: #f8f9fa"] {
        padding: 20px 15px !important;
        line-height: 1.8 !important;
    }
}

/* Horizontal scrolling container for mobile tables */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px -15px;
    padding: 0 15px;
}

/* Improve form validation feedback on mobile */
@media (max-width: 768px) {
    .form-group input:invalid {
        border-color: #dc3545;
        box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
    }
    
    .form-group input:valid {
        border-color: #28a745;
        box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.25);
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .logo {
        font-size: 20px;
    }
    
    .login-title {
        font-size: 20px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .event-title,
    .product-name {
        font-size: 16px;
    }
    
    .current-points {
        font-size: 24px;
    }
    
    .records-table {
        font-size: 12px;
    }
    
    .records-table th,
    .records-table td {
        padding: 8px 6px;
        min-width: 100px;
    }
    
    .modal-content {
        margin: 5px;
        padding: 15px 10px;
        width: calc(100% - 10px);
    }
    
    /* Reduce spacing on very small screens */
    .container {
        padding: 0;
    }
    
    .main-content {
        padding: 10px;
        margin: 0;
    }
}

/* Large screens - improve layout */
@media (min-width: 1200px) {
    .main-content {
        padding: 40px;
    }
    
    .events-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .page-title {
        font-size: 28px;
    }
}

/* Event Registrations Modal Styles */
.large-modal {
    max-width: 90vw;
    width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
}

.registrations-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

/* Export controls styling */
.export-controls {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 20px;
    padding-top: 10px;
}

.btn-export {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-export:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-export:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-export i {
    font-size: 16px;
}

/* Excel button specific styling */
#exportExcelBtn {
    background: #1d7745;
}

#exportExcelBtn:hover {
    background: #155a34;
}

/* CSV button specific styling */
#exportCsvBtn {
    background: #dc3545;
}

#exportCsvBtn:hover {
    background: #c82333;
}

/* Import button specific styling */
.btn-import {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-import:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-import:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Enhanced table styling for more columns */
.registrations-table {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.registrations-table .table {
    min-width: 1200px; /* Increased for more columns */
    margin: 0;
}

.registrations-table .table th {
    background: #e53e3e;
    color: white;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    padding: 12px 8px;
    font-size: 13px;
    border: none;
}

.registrations-table .table td {
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    padding: 10px 8px;
    font-size: 13px;
    border-bottom: 1px solid #dee2e6;
}

.registrations-table .table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Responsive column widths */
.registrations-table .table th:nth-child(1), /* 序號 */
.registrations-table .table td:nth-child(1) {
    width: 60px;
    min-width: 60px;
}

.registrations-table .table th:nth-child(2), /* 姓名 */
.registrations-table .table td:nth-child(2) {
    width: 100px;
    min-width: 100px;
}

.registrations-table .table th:nth-child(3), /* 性別 */
.registrations-table .table td:nth-child(3) {
    width: 60px;
    min-width: 60px;
}

.registrations-table .table th:nth-child(4), /* 身份證 */
.registrations-table .table td:nth-child(4) {
    width: 120px;
    min-width: 120px;
}

.registrations-table .table th:nth-child(5), /* 電話 */
.registrations-table .table td:nth-child(5) {
    width: 110px;
    min-width: 110px;
}

.registrations-table .table th:nth-child(6), /* 電子郵件 */
.registrations-table .table td:nth-child(6) {
    width: 150px;
    min-width: 150px;
}

.registrations-table .table th:nth-child(7), /* LINE ID */
.registrations-table .table td:nth-child(7) {
    width: 120px;
    min-width: 120px;
}

.registrations-table .table th:nth-child(8), /* 服裝尺寸 */
.registrations-table .table td:nth-child(8) {
    width: 80px;
    min-width: 80px;
}

.registrations-table .table th:nth-child(9), /* 飲食偏好 */
.registrations-table .table td:nth-child(9) {
    width: 80px;
    min-width: 80px;
}

.registrations-table .table th:nth-child(10), /* 報名時間 */
.registrations-table .table td:nth-child(10) {
    width: 140px;
    min-width: 140px;
}

.registrations-table .table th:nth-child(11), /* 狀態 */
.registrations-table .table td:nth-child(11) {
    width: 80px;
    min-width: 80px;
}

.registrations-table .table th:nth-child(12), /* 備註 */
.registrations-table .table td:nth-child(12) {
    width: 120px;
    min-width: 120px;
}

/* Summary stats responsive styling */
.summary-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 10px;
}

.stat-item {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 6px;
    border-left: 4px solid #e53e3e;
    min-width: 150px;
}

.registration-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-confirmed {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.status-attended {
    background: #d1ecf1;
    color: #0c5460;
}

.status-no_show {
    background: #fff3cd;
    color: #856404;
}

.view-registrations-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-right: 5px;
}

.view-registrations-btn:hover {
    background: #138496;
    transform: translateY(-1px);
}

/* Action Buttons Layout */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: stretch;
    min-width: 120px;
}

.action-buttons button {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
}

/* Icon styles (using text symbols as fallback) */
.icon-users::before { content: "👥"; font-size: 10px; }
.icon-edit::before { content: "✏️"; font-size: 10px; }
.icon-trash::before { content: "🗑️"; font-size: 10px; }

/* Responsive actions for smaller screens */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 3px;
    }
    
    .action-buttons button {
        font-size: 10px;
        padding: 3px 6px;
        flex: 1;
        min-width: 0;
    }
    
    .action-buttons button span {
        display: none; /* Hide text on mobile, show only icons */
    }
}

/* Improved button styling */
.btn.btn-edit {
    background: #28a745;
    color: white;
}

.btn.btn-edit:hover {
    background: #218838;
    transform: translateY(-1px);
}

.btn.btn-delete {
    background: #dc3545;
    color: white;
}

.btn.btn-delete:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.view-registrations-btn {
    background: #17a2b8;
    color: white;
    font-size: 11px;
    padding: 4px 8px;
}

/* Shopping Cart Styles */
.cart-container {
    position: relative;
    margin: 0 10px;
}

.cart-icon {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.cart-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.cart-icon svg {
    transition: transform 0.3s ease;
}

.cart-icon:hover svg {
    transform: scale(1.1);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e53e3e;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
}

.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-modal.hidden {
    display: none;
}

.cart-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.cart-modal-content {
    position: relative;
    width: 90%;
    max-width: 450px;
    max-height: 80vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.cart-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.cart-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.close-cart {
    cursor: pointer;
    font-size: 24px;
    color: #999;
    line-height: 1;
}

.close-cart:hover {
    color: #333;
}

.cart-content {
    max-height: 400px;
    overflow-y: auto;
}

.cart-items {
    padding: 10px 0;
    min-height: 60px;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #f0f0f0;
}

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

.cart-item-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: #f5f5f5;
    margin-right: 12px;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.cart-item-price {
    color: #e53e3e;
    font-size: 14px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

.cart-qty-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.cart-qty-btn:hover {
    background: #f5f5f5;
}

.cart-qty-display {
    min-width: 30px;
    text-align: center;
    font-weight: bold;
}

.cart-summary {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.total-points {
    font-size: 18px;
    font-weight: bold;
    color: #e53e3e;
    margin-bottom: 15px;
    text-align: center;
}

.cart-actions {
    display: flex;
    gap: 10px;
}

.clear-cart-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #dc3545;
    background: white;
    color: #dc3545;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.clear-cart-btn:hover {
    background: #dc3545;
    color: white;
}

.checkout-btn {
    flex: 2;
    padding: 10px;
    border: none;
    background: #e53e3e;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.checkout-btn:hover:not(:disabled) {
    background: #c53030;
}

.checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-cart-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

/* Hide mobile exchange cards on desktop */
.mobile-exchange-cards {
    display: none;
}

/* Mobile Cart Styles */
@media (max-width: 768px) {
    .cart-modal-content {
        width: 95%;
        max-width: none;
        max-height: 90vh;
        border-radius: 12px;
    }
    
    .cart-content {
        max-height: calc(90vh - 120px);
    }
    
    /* Mobile-optimized cart container */
    .cart-container {
        width: 100% !important;
        max-width: 280px !important;
        margin: 0 auto !important;
        padding: 12px 16px !important;
        display: flex !important;
        justify-content: center !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 12px rgba(0,0,0,0.1) !important;
        border: 1px solid #e53e3e !important;
    }
    
    /* Mobile cart icon optimization */
    .cart-icon {
        justify-content: center !important;
        align-items: center !important;
        gap: 12px !important;
        min-height: 56px !important;
        padding: 8px !important;
        width: 100% !important;
        border-radius: 8px !important;
        transition: background-color 0.2s ease !important;
    }
    
    .cart-icon:active {
        background-color: rgba(229, 62, 62, 0.1) !important;
    }
    
    .cart-icon img {
        width: 36px !important;
        height: 36px !important;
        flex-shrink: 0 !important;
        object-fit: contain !important;
    }
    
    .cart-badge {
        min-width: 26px !important;
        height: 26px !important;
        font-size: 15px !important;
        font-weight: bold !important;
        flex-shrink: 0 !important;
        border-radius: 50% !important;
    }

    /* Mobile points banner optimization */
    .current-points {
        font-size: 22px !important;
        padding: 18px !important;
    }

    /* Better mobile product layout */
    .products-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        margin-bottom: 25px !important;
    }

    .product-card {
        padding: 20px !important;
        border-radius: 16px !important;
        box-shadow: 0 3px 15px rgba(0,0,0,0.1) !important;
    }

    .product-card img {
        max-height: 220px !important;
        width: 100% !important;
        object-fit: contain !important;
        border-radius: 8px !important;
    }

    /* Mobile exchange records optimization - fit all columns without scrolling */
    .table-container {
        overflow-x: visible !important;
        border-radius: 12px !important;
        background: white !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    }

    .records-table {
        width: 100% !important;
        font-size: 14px !important;
        border-collapse: collapse !important;
        table-layout: fixed !important;
    }

    .records-table th,
    .records-table td {
        padding: 12px 6px !important;
        text-align: center !important;
        border-bottom: 1px solid #eee !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    .records-table th {
        background: #f5f5f5 !important;
        font-weight: 600 !important;
        color: #333 !important;
        border-bottom: 1px solid #ddd !important;
        font-size: 14px !important;
    }

    /* Mobile column width distribution */
    .records-table th:nth-child(1),
    .records-table td:nth-child(1) {
        width: 25% !important;
    }

    .records-table th:nth-child(2),
    .records-table td:nth-child(2) {
        width: 20% !important;
    }

    .records-table th:nth-child(3),
    .records-table td:nth-child(3) {
        width: 20% !important;
    }

    .records-table th:nth-child(4),
    .records-table td:nth-child(4) {
        width: 35% !important;
    }

    /* Status and action button styling for mobile */
    .records-table td button {
        font-size: 14px !important;
        padding: 6px 8px !important;
        border-radius: 4px !important;
        background: #e53e3e !important;
        color: white !important;
        border: none !important;
        cursor: pointer !important;
        text-decoration: none !important;
        white-space: nowrap !important;
    }

    /* Hide mobile cards on mobile - use table instead */
    .mobile-exchange-cards {
        display: none !important;
    }

    /* Mobile spacing improvements */
    #exchangeRecordsSection {
        margin-top: 25px !important;
    }

    #exchangeRecordsSection h2 {
        font-size: 18px !important;
        margin-bottom: 15px !important;
    }

    /* Extra small mobile adjustments */
    @media (max-width: 480px) {
        .records-table th,
        .records-table td {
            padding: 8px 4px !important;
            font-size: 13px !important;
        }

        .records-table th {
            font-size: 13px !important;
        }

        .records-table td button {
            font-size: 12px !important;
            padding: 4px 6px !important;
        }
    }

    /* Mobile main content padding */
    .main-content {
        padding: 12px !important;
    }

    /* Points banner cart positioning on mobile - remove absolute positioning */
    #pointsPage .cart-container {
        position: static !important;
        top: auto !important;
        right: auto !important;
        margin: 25px auto 0 auto !important;
    }

    /* Mobile cart section wrapper */
    .cart-section {
        margin: 25px 12px !important;
        padding: 0 !important;
    }
    
    .cart-container {
        margin: 0 auto !important;
    }
}

/* Size selection styling */
.size-selection {
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.size-selection label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.size-selection select {
    padding: 8px 12px;
    border: 2px solid #e53e3e;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s;
}

.size-selection select:focus {
    outline: none;
    border-color: #c53030;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.size-selection select option:disabled {
    color: #999;
    background: #f5f5f5;
} 