/**
 * CSS cho plugin Đặt tên cho trẻ
 */

/* =============================================================================
   Frontend Form Styles
   ============================================================================= */

.dtct-lookup-form-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.dtct-form-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.dtct-form-header h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
}

.dtct-form-description {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
    line-height: 1.5;
}

/* Membership Info */
.dtct-membership-info {
    padding: 15px 30px;
    border-bottom: 1px solid #e0e0e0;
}

.dtct-premium-notice {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
}

.dtct-free-notice {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #8b4513;
    padding: 12px 20px;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
}

.dtct-remaining-count {
    font-weight: 700;
    font-size: 18px;
}

/* Blocked Message */
.dtct-blocked-message {
    padding: 30px;
    text-align: center;
    background: #f8f9fa;
}

.dtct-blocked-message h4 {
    color: #dc3545;
    margin-bottom: 15px;
}

.dtct-contact-info {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
    margin-top: 20px;
    text-align: left;
}

.dtct-contact-info ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.dtct-contact-info li {
    padding: 5px 0;
}

/* Form Styles */
.dtct-frontend-form {
    padding: 30px;
}

.dtct-form-section {
    margin-bottom: 30px;
}

.dtct-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.dtct-form-group {
    margin-bottom: 20px;
}

.dtct-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.required {
    color: #e74c3c;
}

.dtct-form-group input,
.dtct-form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.dtct-form-group input:focus,
.dtct-form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dtct-help-text {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
}

/* Form Actions */
.dtct-form-actions {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.dtct-submit-btn,
.dtct-reset-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dtct-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.dtct-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.dtct-reset-btn {
    background: #6c757d;
    color: white;
}

.dtct-reset-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Loading */
.dtct-loading {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    margin: 20px 30px;
    border-radius: 6px;
}

.dtct-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: dtct-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes dtct-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =============================================================================
   Results Styles
   ============================================================================= */

#dtct-results-container {
    margin: 20px 30px 30px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.dtct-results-header {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.dtct-results-header h3 {
    margin: 0;
    font-size: 20px;
}

.dtct-result-section {
    padding: 20px;
}

.dtct-section {
    background: white;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dtct-section h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.dtct-section h5 {
    margin: 10px 0 8px 0;
    color: #667eea;
    font-size: 16px;
    font-weight: 600;
}

/* Info Grid */
.dtct-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.dtct-info-grid > div {
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
}

/* Analysis Box */
.dtct-analysis-box {
    padding: 16px;
    background: #e8f4f8;
    border: 1px solid #bee5eb;
    border-left: 4px solid #17a2b8;
    border-radius: 4px;
    margin: 15px 0;
}

.dtct-analysis-box.warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    border-left-color: #ffc107;
}

.dtct-analysis-box.error {
    background: #f8d7da;
    border-color: #f5c6cb;
    border-left-color: #dc3545;
}

.dtct-analysis-box p {
    margin: 0 0 10px 0;
}

.dtct-analysis-box p:last-child {
    margin-bottom: 0;
}

/* Name Items */
.dtct-name-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #28a745;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dtct-name-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dtct-name-header {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
}

.dtct-name-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 14px;
}

.dtct-name-score {
    text-align: right;
    font-weight: 700;
    color: #28a745;
    font-size: 16px;
}

.dtct-hanzi {
    font-family: "Microsoft YaHei", "SimSun", "KaiTi", sans-serif;
    font-size: 18px;
    color: #495057;
    font-weight: normal;
}

/* =============================================================================
   Element Colors
   ============================================================================= */

.dtct-element-moc { border-left-color: #28a745; }
.dtct-element-hoa { border-left-color: #dc3545; }
.dtct-element-tho { border-left-color: #ffc107; }
.dtct-element-kim { border-left-color: #6c757d; }
.dtct-element-thuy { border-left-color: #17a2b8; }

/* =============================================================================
   Responsive Design
   ============================================================================= */

@media (max-width: 768px) {
    .dtct-lookup-form-container {
        margin: 10px;
        border-radius: 4px;
    }
    
    .dtct-form-header {
        padding: 20px;
    }
    
    .dtct-form-header h3 {
        font-size: 20px;
    }
    
    .dtct-frontend-form {
        padding: 20px;
    }
    
    .dtct-form-row,
    .dtct-info-grid,
    .dtct-name-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .dtct-submit-btn,
    .dtct-reset-btn {
        width: 100%;
        margin: 5px 0;
        justify-content: center;
    }
    
    #dtct-results-container {
        margin: 20px 10px;
    }
    
    .dtct-result-section {
        padding: 15px;
    }
    
    .dtct-section {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .dtct-form-header {
        padding: 15px;
    }
    
    .dtct-form-header h3 {
        font-size: 18px;
    }
    
    .dtct-form-description {
        font-size: 14px;
    }
    
    .dtct-frontend-form {
        padding: 15px;
    }
    
    .dtct-membership-info {
        padding: 10px 15px;
    }
    
    .dtct-name-header {
        font-size: 16px;
    }
}

/* =============================================================================
   Utility Classes
   ============================================================================= */

.dtct-full-width {
    grid-column: span 2 !important;
}

.dtct-text-center {
    text-align: center;
}

.dtct-text-left {
    text-align: left;
}

.dtct-text-right {
    text-align: right;
}

.dtct-mb-10 {
    margin-bottom: 10px;
}

.dtct-mb-20 {
    margin-bottom: 20px;
}

.dtct-mt-10 {
    margin-top: 10px;
}

.dtct-mt-20 {
    margin-top: 20px;
}

/* =============================================================================
   Print Styles
   ============================================================================= */

@media print {
    .dtct-form-actions,
    .dtct-loading,
    .dtct-membership-info {
        display: none !important;
    }
    
    .dtct-lookup-form-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .dtct-section {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}