/**
 * Frontend Stylesheet
 *
 * @package NPD_Tools
 * @version 1.0.0
 */

/* ============================================
   LAYER 1: Global Entry Card
   ============================================ */
.npd-layer-1-wrapper {
    margin: 30px 0;
}

.npd-global-entry-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    color: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.npd-global-entry-card h4 {
    font-size: 22px;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.npd-global-entry-card p {
    font-size: 16px;
    margin: 0 0 20px 0;
    opacity: 0.95;
}

.npd-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #fff;
    color: #667eea;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.npd-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-decoration: none;
    color: #667eea;
}

.npd-btn-primary {
    background: #0073aa;
    color: #fff;
}

.npd-btn-primary:hover {
    background: #005a87;
    color: #fff;
}

.npd-btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

.npd-btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

/* ============================================
   LAYER 2: Context Slot
   ============================================ */
.npd-layer-2-wrapper {
    margin: 30px 0;
}

.npd-context-slot {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
}

.npd-context-slot-header {
    margin-bottom: 15px;
}

.npd-context-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    font-weight: 600;
}

.npd-context-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

/* Tool cards */
.npd-tool-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    flex: 1;
    min-width: 250px;
}

.npd-tool-card h5 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

/* Safety Checker Styles */
.npd-safety-checker-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 15px;
}

.npd-safety-checker-compact {
    flex: 1;
    min-width: 200px;
}

.npd-safety-compact-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.npd-safety-compact-form {
    display: flex;
    gap: 8px;
}

.npd-safety-compact-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.npd-safety-result-compact {
    margin-top: 10px;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
}

/* Safety status colors */
.npd-status-safe {
    color: #28a745;
}

.npd-status-caution {
    color: #ffc107;
}

.npd-status-avoid {
    color: #dc3545;
}

/* Treat Budget & Portion Converter */
.npd-treat-budget-compact,
.npd-portion-compact {
    flex: 1;
    min-width: 200px;
}

.npd-treat-compact-title,
.npd-portion-compact-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* ============================================
   LAYER 3: Next Steps Module
   ============================================ */
.npd-layer-3-wrapper {
    margin: 40px 0;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.npd-next-steps-module {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
}

.npd-next-steps-module h3 {
    margin: 0 0 20px 0;
    font-size: 22px;
    color: #333;
}

.npd-next-primary {
    margin-bottom: 20px;
}

.npd-next-primary h4 {
    font-size: 14px;
    text-transform: uppercase;
    color: #6c757d;
    margin: 0 0 10px 0;
}

.npd-next-rules {
    margin-bottom: 20px;
}

.npd-next-rules h4 {
    font-size: 14px;
    text-transform: uppercase;
    color: #6c757d;
    margin: 0 0 10px 0;
}

.npd-next-rules ol {
    margin: 0;
    padding-left: 20px;
}

.npd-next-rules li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.npd-next-tools h4,
.npd-next-secondary h4 {
    font-size: 14px;
    text-transform: uppercase;
    color: #6c757d;
    margin: 0 0 10px 0;
}

.npd-tool-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.npd-tool-link,
.npd-next-secondary a {
    display: block;
    padding: 10px 15px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
}

.npd-tool-link:hover,
.npd-next-secondary a:hover {
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-color: #0073aa;
}

.npd-next-secondary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.npd-next-secondary li {
    margin-bottom: 8px;
}

.npd-resource-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #e9ecef;
    border-radius: 12px;
    font-size: 12px;
    color: #6c757d;
    margin-right: 8px;
}

/* ============================================
   Mobile Sticky Bar
   ============================================ */
.npd-mobile-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 9999;
    padding: 10px 15px;
}

.npd-sticky-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}

.npd-sticky-text {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.npd-sticky-btn {
    padding: 8px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    text-decoration: none;
}

/* ============================================
   Tool Page Styles
   ============================================ */
.npd-tool-page-wrapper {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.npd-tool-container h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.npd-tool-subtitle {
    font-size: 18px;
    color: #6c757d;
    margin-bottom: 30px;
}

/* Form styles */
.npd-path-picker-form,
.npd-safety-checker-main,
.npd-food-finder-main {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
}

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

.npd-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.npd-red-flag-label {
    color: #dc3545;
}

.npd-help-text {
    font-size: 14px;
    color: #6c757d;
    margin: 5px 0 10px 0;
}

.npd-red-flag-list {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px 20px;
    margin: 10px 0;
    list-style: none;
}

.npd-red-flag-list li {
    padding: 5px 0;
}

.npd-red-flag-list strong {
    color: #856404;
}

/* Radio & Checkbox groups */
.npd-radio-group,
.npd-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.npd-radio-option,
.npd-checkbox-option {
    display: flex;
    align-items: flex-start;
    padding: 10px 15px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.npd-radio-option:hover,
.npd-checkbox-option:hover {
    border-color: #0073aa;
    background: #f8f9fa;
}

.npd-radio-option input,
.npd-checkbox-option input {
    margin-right: 10px;
    margin-top: 2px;
}

.npd-radio-option span,
.npd-checkbox-option span {
    flex: 1;
}

.npd-red-flag-yes {
    border-color: #dc3545;
    background: #ffebee;
}

.npd-red-flag-yes:hover {
    border-color: #dc3545;
    background: #ffcdd2;
}

/* Input styles */
.npd-safety-input,
.npd-safety-input-large {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.npd-safety-input-large {
    padding: 15px 20px;
    font-size: 18px;
}

.npd-safety-input:focus,
.npd-safety-input-large:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

/* Result styles */
.npd-path-result {
    margin-top: 30px;
    padding: 25px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.npd-alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.npd-alert-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.npd-alert-warning h3 {
    margin: 0 0 10px 0;
    color: #856404;
}

.npd-result-primary {
    margin: 20px 0;
}

.npd-result-rules {
    margin: 20px 0;
    padding: 15px;
    background: #e7f3ff;
    border-radius: 5px;
}

.npd-result-rules h4 {
    margin: 0 0 10px 0;
}

.npd-result-rules ol {
    margin: 0;
    padding-left: 20px;
}

/* FAQ Section */
.npd-tool-faq {
    margin-top: 40px;
}

.npd-tool-faq h2 {
    margin-bottom: 20px;
}

.npd-faq-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

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

.npd-faq-item h3 {
    font-size: 18px;
    margin: 0 0 10px 0;
}

.npd-faq-item p {
    color: #6c757d;
    line-height: 1.6;
}

/* Related Links */
.npd-tool-related {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.npd-tool-related h2 {
    margin-bottom: 15px;
}

.npd-tool-related ul {
    list-style: none;
    padding: 0;
}

.npd-tool-related li {
    margin-bottom: 10px;
}

.npd-tool-related a {
    color: #0073aa;
    text-decoration: none;
}

.npd-tool-related a:hover {
    text-decoration: underline;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .npd-global-entry-card {
        padding: 20px;
    }

    .npd-global-entry-card h4 {
        font-size: 18px;
    }

    .npd-context-tools {
        flex-direction: column;
    }

    .npd-tool-card {
        min-width: 100%;
    }

    .npd-tool-page-wrapper {
        padding: 0 15px;
        margin: 20px auto;
    }

    .npd-tool-container h1 {
        font-size: 24px;
    }

    .npd-tool-subtitle {
        font-size: 16px;
    }

    .npd-sticky-text {
        font-size: 13px;
    }

    .npd-sticky-btn {
        padding: 6px 15px;
        font-size: 14px;
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes npd-spin {
    to {
        transform: rotate(360deg);
    }
}

.npd-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.npd-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #0073aa;
    border-top-color: transparent;
    border-radius: 50%;
    animation: npd-spin 0.8s linear infinite;
}

/* Hide elements */
.npd-hidden {
    display: none !important;
}

/* ============================================
   7-Day Reset Plan - What This Is Block
   ============================================ */
.npd-what-this-is {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eef5 100%);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid #dee2e6;
}

.npd-wti-header h1 {
    font-size: 28px;
    margin: 0 0 10px 0;
    color: #333;
}

.npd-wti-subtitle {
    font-size: 18px;
    color: #6c757d;
    margin: 0 0 25px 0;
    font-weight: 400;
}

.npd-wti-bullets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.npd-wti-bullet {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.npd-wti-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #28a745;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

.npd-wti-note {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 15px;
    margin: 0;
    font-size: 14px;
    color: #856404;
    border-radius: 4px;
}

/* ============================================
   Pro CTA Section (for Pro users)
   ============================================ */
.npd-pro-cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    color: #fff;
}

.npd-pro-cta-section h2 {
    font-size: 24px;
    margin: 0 0 20px 0;
    color: #fff;
}

.npd-pro-cta-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.npd-pro-cta-primary,
.npd-pro-cta-secondary {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.npd-pro-cta-primary h3,
.npd-pro-cta-secondary h3 {
    font-size: 18px;
    margin: 0 0 10px 0;
    color: #fff;
}

.npd-pro-cta-primary p,
.npd-pro-cta-secondary p {
    font-size: 14px;
    margin: 0 0 15px 0;
    opacity: 0.95;
}

.npd-pro-cta-primary .npd-btn {
    background: #fff;
    color: #667eea;
}

.npd-pro-cta-secondary .npd-btn {
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
}

.npd-pro-cta-secondary .npd-btn:hover {
    background: #fff;
    color: #667eea;
}

/* ============================================
   Upsell Card (for non-Pro users)
   ============================================ */
.npd-upsell-card {
    background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    border: 2px solid #ffc107;
}

.npd-upsell-header {
    margin-bottom: 20px;
}

.npd-upsell-header h3 {
    font-size: 22px;
    margin: 0 0 8px 0;
    color: #856404;
}

.npd-upsell-subtitle {
    font-size: 16px;
    color: #856404;
    margin: 0;
    opacity: 0.9;
}

.npd-upsell-features {
    margin-bottom: 25px;
}

.npd-upsell-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
}

.npd-upsell-icon {
    font-size: 20px;
}

.npd-upsell-cta {
    text-align: center;
}

.npd-upsell-cta .npd-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 14px 32px;
    font-size: 16px;
}

.npd-upsell-cta .npd-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.3);
    color: #fff;
}

/* ============================================
   Plan History & View/Print
   ============================================ */
.npd-plan-history {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.npd-plan-history h3 {
    font-size: 20px;
    margin: 0 0 15px 0;
    color: #333;
}

.npd-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.npd-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.npd-history-meta {
    flex: 1;
}

.npd-history-meta strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
    color: #333;
}

.npd-history-date {
    font-size: 13px;
    color: #6c757d;
}

.npd-history-actions {
    display: flex;
    gap: 8px;
}

.npd-history-actions .npd-btn {
    padding: 8px 16px;
    font-size: 14px;
}

.npd-plan-back-link {
    margin-bottom: 20px;
}

.npd-plan-back-link a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.npd-plan-back-link a:hover {
    text-decoration: underline;
}

/* Reset Plan Result */
.npd-reset-plan-result {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.npd-plan-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.npd-plan-header h2 {
    font-size: 26px;
    margin: 0 0 10px 0;
    color: #333;
}

.npd-plan-subtitle {
    font-size: 14px;
    color: #6c757d;
    margin: 0 0 15px 0;
}

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

.npd-plan-day {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #0073aa;
}

.npd-plan-day h3,
.npd-plan-day h4 {
    margin: 0 0 12px 0;
    color: #0073aa;
}

.npd-plan-day-0 {
    background: #e7f3ff;
    border-left-color: #0056b3;
}

.npd-plan-checkpoint {
    background: #e7f3ff;
    border-left-color: #667eea;
    border: 2px solid #667eea;
}

.npd-task-list {
    margin: 0;
    padding-left: 20px;
}

.npd-task-list li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.npd-day-task {
    font-size: 16px;
    margin-bottom: 10px;
}

.npd-day-pitfall {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 14px;
}

.npd-day-link {
    margin-top: 10px;
}

.npd-day-link a {
    color: #0073aa;
    text-decoration: none;
}

.npd-day-link a:hover {
    text-decoration: underline;
}

.npd-checkpoint-options {
    margin-top: 15px;
    padding: 15px;
    background: #fff;
    border-radius: 4px;
}

.npd-checkpoint-options p {
    margin: 0 0 10px 0;
    font-weight: 600;
}

.npd-medical-disclaimer {
    margin-top: 30px;
    padding: 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    font-size: 13px;
}

.npd-medical-disclaimer p {
    margin: 0;
    color: #856404;
}

.npd-email-success {
    color: #28a745;
    font-weight: 600;
}

.npd-email-warning {
    color: #ffc107;
    font-weight: 600;
}

/* Print styles */
@media print {
    .npd-plan-actions,
    .npd-plan-back-link,
    .npd-history-section {
        display: none !important;
    }

    .npd-reset-plan-result {
        box-shadow: none !important;
        border: none !important;
    }
}

/* Responsive for plan page */
@media (max-width: 768px) {
    .npd-wti-bullets {
        grid-template-columns: 1fr;
    }

    .npd-pro-cta-cards {
        grid-template-columns: 1fr;
    }

    .npd-history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .npd-history-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .npd-what-this-is,
    .npd-pro-cta-section,
    .npd-upsell-card,
    .npd-plan-history {
        padding: 20px;
    }
}
