/* 加工參數大師樣式 */

/* 基礎樣式 */
.mc-calculator {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

.mc-calculator h2 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 28px;
}

.mc-calculator h3 {
    color: #555;
    margin-bottom: 20px;
    font-size: 20px;
}

/* 表單樣式 */
.mc-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mc-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.mc-form-group {
    flex: 1;
    position: relative;
}

.mc-form-group.full-width {
    width: 100%;
}

.mc-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.mc-form-group input,
.mc-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.mc-form-group input:focus,
.mc-form-group select:focus {
    outline: none;
    border-color: #3570EA;
}

/* 自動計算字段樣式 */
.mc-form-group input[data-auto-calc="true"] {
    background: linear-gradient(45deg, #f8f9fa 25%, transparent 25%, transparent 75%, #f8f9fa 75%, #f8f9fa),
                linear-gradient(45deg, #f8f9fa 25%, transparent 25%, transparent 75%, #f8f9fa 75%, #f8f9fa);
    background-size: 8px 8px;
    background-position: 0 0, 4px 4px;
    border-left: 3px solid #28a745;
}

.mc-form-group input[data-auto-calc="true"]:focus {
    border-left: 3px solid #28a745;
    border-color: #3570EA;
}

/* 即時計算提示 */
.mc-form-group::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
}

.mc-form-group:has(input[data-auto-calc="true"])::after {
    opacity: 1;
}

.mc-auto-calc-hint {
    font-size: 12px;
    color: #28a745;
    margin-top: 4px;
    display: none;
}

.mc-form-group:has(input[data-auto-calc="true"]) .mc-auto-calc-hint {
    display: block;
}

/* 按鈕樣式 */
.mc-form-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 30px;
}

.mc-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.mc-btn-primary {
    background: #3570EA;
    color: white;
}

.mc-btn-primary:hover {
    background: #2760DA;
}

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

.mc-btn-secondary:hover {
    background: #5a6268;
}

.mc-btn-success {
    background: #28a745;
    color: white;
}

.mc-btn-success:hover {
    background: #218838;
}

/* 結果顯示樣式 */
.mc-results {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 30px;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mc-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.mc-result-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    text-align: center;
    transition: transform 0.2s;
}

.mc-result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.mc-result-item label {
    display: block;
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.mc-result-item span {
    display: block;
    color: #3570EA;
    font-size: 24px;
    font-weight: bold;
}

/* 保存記錄 */
.mc-save-record {
    display: flex;
    gap: 10px;
    align-items: center;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.mc-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* 計算說明 */
.mc-calculation-info {
    background: #e9ecef;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #495057;
}

.mc-calculation-info h4 {
    margin: 0 0 10px 0;
    color: #343a40;
    font-size: 16px;
}

.mc-calculation-info ul {
    margin: 0;
    padding-left: 20px;
}

.mc-calculation-info li {
    margin-bottom: 5px;
}

/* 材料數據庫樣式 */
.mc-materials-database {
    max-width: 1200px;
    margin: 0 auto;
}

.mc-search-bar {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.mc-search-bar input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.mc-category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.mc-tab {
    padding: 10px 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.mc-tab:hover {
    background: #f8f9fa;
}

.mc-tab.active {
    background: #3570EA;
    color: white;
    border-color: #3570EA;
}

.mc-materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.mc-material-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.mc-material-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.mc-material-card h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 20px;
}

.mc-material-info {
    margin-bottom: 15px;
}

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

.mc-material-info strong {
    color: #333;
}

.mc-cutting-params {
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.mc-cutting-params h5 {
    color: #555;
    margin-bottom: 10px;
    font-size: 16px;
}

.mc-param-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mc-param-list li {
    padding: 5px 0;
    color: #666;
    font-size: 14px;
}

/* 參數記錄樣式 */
.mc-parameter-records {
    max-width: 1000px;
    margin: 0 auto;
}

.mc-records-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.mc-records-stats {
    display: flex;
    gap: 20px;
}

.mc-stat-item {
    text-align: center;
}

.mc-stat-item .count {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #3570EA;
}

.mc-stat-item .label {
    display: block;
    color: #666;
    font-size: 14px;
}

.mc-records-list {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mc-record-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
    transition: background 0.3s;
}

.mc-record-item:hover {
    background: #f8f9fa;
}

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

.mc-record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.mc-record-title {
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

.mc-record-date {
    color: #999;
    font-size: 14px;
}

.mc-record-data {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.mc-record-data-item {
    font-size: 14px;
    color: #666;
}

.mc-record-data-item strong {
    color: #333;
}

.mc-record-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.mc-btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .mc-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .mc-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mc-materials-grid {
        grid-template-columns: 1fr;
    }
    
    .mc-save-record {
        flex-direction: column;
    }
    
    .mc-records-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .mc-category-tabs {
        justify-content: center;
    }
    
    .mc-record-data {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .mc-calculator {
        padding: 15px;
    }
    
    .mc-form {
        padding: 20px;
    }
    
    .mc-results-grid {
        grid-template-columns: 1fr;
    }
    
    .mc-records-stats {
        flex-direction: column;
        gap: 10px;
    }
}

/* 材料數據庫樣式 */
.mc-materials-database .mc-search-section {
    margin-bottom: 20px;
}

.mc-materials-database #material-search {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.mc-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.mc-tab {
    padding: 10px 20px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mc-tab.active {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.mc-tab:hover {
    background: #0073aa;
    color: white;
}

.mc-materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.mc-material-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mc-material-card h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
}

.mc-material-info p {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.4;
}

.mc-cutting-params {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.mc-cutting-params h5 {
    margin: 0 0 10px 0;
    color: #555;
    font-size: 14px;
}

.mc-param-section {
    margin-bottom: 10px;
}

.mc-param-list {
    margin: 5px 0 0 20px;
    padding: 0;
    font-size: 13px;
}

.mc-param-list li {
    margin: 3px 0;
}

/* 參數記錄樣式 */
.mc-parameter-records .mc-login-notice {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.mc-records-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.mc-record-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.mc-record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.mc-record-type {
    background: #007cba;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    text-transform: uppercase;
}

.mc-record-date {
    font-size: 12px;
    color: #666;
}

.mc-record-data {
    font-size: 14px;
    line-height: 1.4;
}

.mc-record-data strong {
    color: #333;
}

.mc-record-note {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-style: italic;
    color: #666;
}

.mc-delete-record {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
}

.mc-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.mc-empty {
    text-align: center;
    padding: 40px;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .mc-tabs {
        flex-direction: column;
    }
    
    .mc-tab {
        text-align: center;
    }
    
    .mc-materials-grid,
    .mc-records-grid {
        grid-template-columns: 1fr;
    }
} 