/* 随礼记录页面特有样式 */

/* 搜索和筛选区域新样式 */
.search-filter-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-filter-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    flex: 1;
}

.search-filter-right {
    display: flex;
    align-items: center;
}

/* 自定义下拉选择组件样式 */
.custom-select-container {
    position: relative;
}

#guest-search-input[readonly],
#gift-reason-search-input[readonly] {
    background-color: white;
    cursor: pointer;
}

.select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #666;
    pointer-events: none;
    transition: transform 0.3s ease;
}

.custom-select-container.open .select-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.custom-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 0.25rem 0.25rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.custom-dropdown.open {
    display: block;
}

.dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item.selected {
    background-color: #e3f2fd;
}

/* 筛选条件样式 */
.filters {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-item label {
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
    font-size: 15px;
}

.filter-select,
.filter-date,
.filter-amount {
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    background-color: white;
    box-sizing: border-box;
}

.filter-select:focus,
.filter-date:focus,
.filter-amount:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.filter-amount {
    width: 120px;
}

.filter-clear-btn {
    padding: 12px 20px;
    background: #6c757d;
    color: white;
    border: 2px solid #6c757d;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-clear-btn:hover {
    background: #5a6268;
    color: white;
    transform: translateY(-1px);
}

/* 统计卡片样式 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.stat-title {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
}

/* 随礼记录卡片样式 */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.gift-card {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 4px solid #4CAF50;
}

.gift-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.gift-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.gift-recipient {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.gift-time {
    font-size: 12px;
    color: #999;
}

/* 时间展示样式 - 改为有背景区域的样式 */
.gift-time {
    font-size: 12px;
}

.gift-time-container {
    display: inline-block;
    background-color: #e3f2fd;
    padding: 4px 12px;
    border-radius: 16px;
}

.gift-time-container .year {
    font-size: 14px;
    font-weight: bold;
    color: #1976D2;
}

.gift-time-container .month {
    font-size: 12px;
    font-weight: 500;
    color: #3F51B5;
}

.gift-time-container .day {
    font-size: 12px;
    font-weight: 500;
    color: #3F51B5;
}

.gift-time-container .separator {
    font-size: 10px;
    color: #7986CB;
    margin: 0 2px;
}

.gift-amount {
    font-size: 24px;
    font-weight: bold;
    color: #ff6b35;
    margin-bottom: 12px;
}

.gift-reason {
    display: inline-block;
    background-color: #f0f0f0;
    color: #666;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    margin-bottom: 12px;
}

.gift-remark {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 16px;
    word-break: break-word;
}

.gift-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.gift-card-footer .btn {
    padding: 6px 16px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gift-card-footer .edit-btn {
    background-color: #007bff;
    color: white;
    border: 1px solid #007bff;
    margin-right: 8px;
}

.gift-card-footer .edit-btn:hover {
    background-color: #0056b3;
    border-color: #004085;
}

.gift-card-footer .delete-btn {
    background-color: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.gift-card-footer .delete-btn:hover {
    background-color: #bb2d3b;
    border-color: #b02a37;
}

/* 空数据状态 */
.no-data {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* 分页控件样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid #4CAF50;
    background-color: #4CAF50;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #45a049;
    border-color: #45a049;
}

.pagination-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    background-color: #ccc;
    border-color: #ccc;
}

.pagination-btn-active {
    background-color: #2e7d32 !important;
    color: white !important;
    border-color: #2e7d32 !important;
}

.pagination-ellipsis {
    padding: 0 8px;
    color: #999;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

/* 按钮样式覆盖 */
.btn-primary {
    color: white;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    color: white;
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

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

.btn-danger:hover {
    color: white;
    background-color: #bb2d3b;
    border-color: #b02a37;
}

.btn-secondary {
    color: white;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    color: white;
    background-color: #5a6268;
    border-color: #545b62;
}

/* 搜索按钮样式 */
.search-btn {
    padding: 12px 20px;
    background-color: #28a745;
    color: white;
    border: 2px solid #28a745;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.search-btn:hover {
    background-color: #218838;
    border-color: #1e7e34;
    transform: translateY(-1px);
}

/* 新增按钮样式 */
.add-btn {
    padding: 12px 24px;
    background-color: #007bff;
    color: white;
    border: 2px solid #007bff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.add-btn:hover {
    background-color: #0056b3;
    border-color: #004085;
    transform: translateY(-1px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

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

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.close-modal {
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

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

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 错误提示样式 */
.modal-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    min-height: 18px;
}

#modal-global-error {
    padding: 0 20px 20px 20px;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-add {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-container {
        min-width: auto;
    }
    
    .filters {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-item {
        justify-content: space-between;
    }
    
    .filter-select,
    .filter-amount {
        flex: 1;
    }
    
    /* 响应式设计 */
@media (max-width: 768px) {
    .search-filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-filter-left {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .search-filter-right {
        width: 100%;
        justify-content: center;
    }
    
    .search-input,
    .filter-select {
        width: 100%;
    }
    
    .filter-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-item label {
        margin-bottom: 8px;
    }
}
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .cards-container {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
}