/**
 * 安全期计算器样式
 */

/* 主容器样式 */
.pwt-safe-period-calculator-container {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    margin: 0 auto 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
    line-height: 1.5;
}

/* 表单区域 */
.pwt-safe-period-inputs {
    margin-bottom: 24px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
}

.pwt-safe-period-inputs .pwt-form-group {
    margin-bottom: 20px;
}

.pwt-safe-period-inputs .pwt-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
    font-size: 15px;
}

.pwt-safe-period-inputs .required {
    color: #e74c3c;
    margin-left: 3px;
}

.pwt-safe-period-inputs .pwt-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 15px;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.pwt-safe-period-inputs .pwt-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
    outline: none;
}

.pwt-safe-period-inputs .pwt-input-hint {
    margin-top: 6px;
    font-size: 13px;
    color: #777;
    line-height: 1.4;
}

.pwt-safe-period-inputs .pwt-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-start;
}

.pwt-safe-period-inputs .pwt-button {
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.pwt-safe-period-inputs .pwt-calculate-btn {
    background-color: #3498db;
    color: white;
}

.pwt-safe-period-inputs .pwt-calculate-btn:hover {
    background-color: #2980b9;
}

.pwt-safe-period-inputs .pwt-button-secondary {
    background-color: #f1f1f1;
    color: #555;
}

.pwt-safe-period-inputs .pwt-button-secondary:hover {
    background-color: #e1e1e1;
}

/* 状态显示面板 */
.pwt-status-panel {
    margin-bottom: 24px;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

.pwt-status-today {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.pwt-status-today h4 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 17px;
    color: #333;
    position: relative;
    padding-left: 10px;
}

.pwt-status-today h4::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    height: 16px;
    width: 4px;
    background-color: #3498db;
    border-radius: 2px;
}

.pwt-today-status {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #222;
}

.pwt-conception-probability {
    font-size: 15px;
    color: #555;
    padding: 6px 0;
}

.pwt-conception-probability.pwt-high-prob {
    color: #e74c3c;
}

.pwt-conception-probability.pwt-low-prob {
    color: #27ae60;
}

.pwt-period-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 15px;
    color: #444;
}

/* 日历容器 */
.pwt-calendar-container {
    margin-bottom: 30px;
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

.pwt-calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.pwt-nav-button {
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
}

.pwt-nav-button:hover {
    background-color: #e9ecef;
}

.pwt-current-month {
    font-weight: 500;
    font-size: 1.1em;
}

/* 多月份日历样式 */
.pwt-months-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
    padding: 5px 0;
}

.pwt-months-range {
    font-size: 18px;
    font-weight: 500;
    flex-grow: 1;
    text-align: center;
}

.pwt-prev-months, .pwt-next-months, .pwt-return-today {
    padding: 5px 10px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pwt-prev-months, .pwt-next-months {
    min-width: 40px;
}

/* 日历上方导航样式已移除 */

/* 返回按钮，在导航区域内 */
.pwt-return-today {
    background-color: #3498db;
    color: white;
    font-size: 14px;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.3);
    margin-left: 10px;
}

.pwt-prev-months:hover, .pwt-next-months:hover {
    background-color: #e9ecef;
    transform: translateY(-1px);
}

.pwt-return-today:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.4);
}

.pwt-return-today:active {
    transform: translateY(1px);
}

.pwt-month-container {
    margin-bottom: 25px;
    box-sizing: border-box;
    padding: 0 8px;
}

/* 在大屏幕上以网格形式排列月份 */
@media (min-width: 768px) {
    .pwt-calendar {
        display: flex;
        flex-wrap: wrap;
        margin: 0 -8px;
    }
    
    .pwt-month-container {
        padding: 0 8px;
        margin-bottom: 25px;
    }
}

/* 根据当前显示的月份数量动态调整宽度 */
.pwt-months-1 .pwt-month-container { width: 100%; }
.pwt-months-2 .pwt-month-container { width: 50%; }
.pwt-months-3 .pwt-month-container { width: 50%; }
.pwt-months-4 .pwt-month-container { width: 50%; }
.pwt-months-5 .pwt-month-container { width: 50%; }
.pwt-months-6 .pwt-month-container { width: 50%; }

@media (max-width: 1200px) {
    .pwt-months-6 .pwt-month-container,
    .pwt-months-5 .pwt-month-container,
    .pwt-months-4 .pwt-month-container { width: 33.333%; }
}

@media (max-width: 992px) {
    .pwt-months-6 .pwt-month-container,
    .pwt-months-5 .pwt-month-container,
    .pwt-months-4 .pwt-month-container,
    .pwt-months-3 .pwt-month-container { width: 50%; }
}

@media (max-width: 767px) {
    .pwt-month-container {
        width: 100% !important;
    }
}

.pwt-month-title {
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    margin: 8px 0 12px;
    color: #333;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

/* 日历表格样式 */
.pwt-month-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 1px;
    table-layout: fixed;
    margin-bottom: 15px;
    background-color: #f8f8f8;
    border-radius: 6px;
    overflow: hidden;
}

.pwt-month-table th {
    padding: 12px 8px;
    text-align: center;
    background-color: #f0f5fa;
    font-weight: 500;
    color: #444;
    font-size: 14px;
    border: none;
}

.pwt-month-table td {
    padding: 10px 5px;
    text-align: center;
    border: none;
    position: relative;
    transition: all 0.2s ease;
    font-size: 14px;
    border-radius: 4px;
    margin: 2px;
}

.pwt-month-table td:hover:not(.pwt-empty) {
    transform: scale(1.05);
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.pwt-month-table td.pwt-empty {
    background-color: #f8f9fa;
}

/* 经期样式 - 深红色 */
.pwt-month-table td.pwt-period-day {
    background-color: #ffccd5;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(255, 99, 71, 0.2);
}

/* 预测经期样式 - 浅红色边框 */
.pwt-month-table td.pwt-predicted-period {
    background-color: #ffe5e5;
    box-shadow: 0 0 0 2px rgba(255, 99, 71, 0.3);
}

/* 月经第一天特殊标记 */
.pwt-month-table td.pwt-period-first-day {
    position: relative;
    overflow: visible;
}

.pwt-month-table td.pwt-period-first-day::after {
    content: '●';
    position: absolute;
    top: -2px;
    right: 2px;
    font-size: 14px;
    color: #e02020;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(255,255,255,0.8);
}

/* 易孕期样式 - 蓝色 */
.pwt-month-table td.pwt-fertile-day {
    background-color: #cce5ff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.15);
}

/* 排卵日样式 */
.pwt-month-table td.pwt-ovulation-day {
    position: relative;
    background-color: #9ec5fe;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.25);
}

.pwt-month-table td.pwt-ovulation-day::before {
    content: '✨';
    position: absolute;
    top: 1px;
    right: 1px;
    font-size: 12px;
    color: #0055b3;
    text-shadow: 0 0 3px rgba(255,255,255,0.8);
}

/* 安全期样式 - 绿色 */
.pwt-month-table td.pwt-safe-day {
    background-color: #d4edda;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.15);
}

/* 今天样式 */
.pwt-month-table td.pwt-today {
    outline: 2px solid #007bff;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.4);
    z-index: 1;
    font-weight: 600;
}

/* 日历图例样式 */
.pwt-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 20px;
    padding: 16px 20px;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    justify-content: center;
    border: none;
}

.pwt-legend-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #444;
    margin: 4px 8px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: transform 0.2s ease;
}

.pwt-legend-item:hover {
    transform: translateY(-1px);
}

.pwt-legend-color {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: none;
}

.pwt-legend-item.pwt-period-day .pwt-legend-color {
    background-color: #ffccd5;
    position: relative;
    box-shadow: 0 2px 4px rgba(255, 99, 71, 0.2);
}

.pwt-period-first-day .pwt-legend-color::after {
    content: '●';
    position: absolute;
    top: -15%;
    right: 2%;
    font-size: 12px;
    color: #e02020;
    text-shadow: 0 0 2px rgba(255,255,255,0.8);
}

.pwt-legend-item.pwt-fertile-day .pwt-legend-color {
    background-color: #cce5ff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.15);
}

.pwt-legend-item.pwt-ovulation-day .pwt-legend-color {
    background-color: #9ec5fe;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.25);
}

.pwt-legend-item.pwt-ovulation-day .pwt-legend-color::before {
    content: '✨';
    position: absolute;
    top: 0px;
    right: 0px;
    font-size: 12px;
    color: #0055b3;
    text-shadow: 0 0 3px rgba(255,255,255,0.8);
}

.pwt-legend-item.pwt-safe-day .pwt-legend-color {
    background-color: #d4edda;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.15);
}

.pwt-legend-item.pwt-today .pwt-legend-color {
    border: 2px solid #007bff;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.4);
}

/* 免责声明 */
.pwt-disclaimer {
    margin-top: 35px;
    padding: 20px 25px;
    background-color: #f9f9f9;
    border-left: 4px solid #3498db;
    font-size: 14px;
    color: #444;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.pwt-disclaimer p {
    margin: 12px 0;
    line-height: 1.6;
}

.pwt-disclaimer strong {
    font-weight: 600;
    color: #2c3e50;
}

/* 响应式设计调整 */
@media (max-width: 768px) {
    .pwt-safe-period-calculator-container {
        margin: 0 auto 20px;
    }
    
    .pwt-safe-period-inputs {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .pwt-status-panel,
    .pwt-calendar-container {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .pwt-month-table th,
    .pwt-month-table td {
        padding: 8px 4px;
        font-size: 14px;
    }
    
    .pwt-calendar-legend {
        gap: 10px;
        padding: 14px;
        margin-top: 15px;
    }
    
    .pwt-legend-item {
        font-size: 13px;
    }
    
    .pwt-legend-color {
        width: 18px;
        height: 18px;
    }
    
    .pwt-months-navigation {
        justify-content: center;
        gap: 8px;
    }
    
    .pwt-months-range {
        order: -1;
        width: 100%;
        margin-bottom: 10px;
        text-align: center;
    }
    
    .pwt-return-today {
        font-size: 14px;
        padding: 8px 16px;
        margin: 0 5px;
    }
    
    .pwt-disclaimer {
        padding: 15px;
        margin-top: 25px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .pwt-safe-period-inputs .pwt-form-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .pwt-safe-period-inputs .pwt-button {
        width: 100%;
    }
    
    .pwt-calendar-legend {
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
    }
    
    .pwt-months-navigation {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .pwt-prev-months, .pwt-next-months, .pwt-return-today {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .pwt-month-table td {
        height: 32px;
        padding: 4px 2px;
        font-size: 13px;
    }
    
    .pwt-month-table td.pwt-period-first-day::after {
        font-size: 12px;
        top: -2px;
        right: 1px;
    }
    
    .pwt-month-table td.pwt-ovulation-day::before {
        font-size: 10px;
    }
}