/**
 * Public Roadmap Styles
 * 
 * CSS for the [public_roadmap] shortcode display.
 * Add this as a CSS snippet in WP Code (set to run in the header).
 * 
 * Design based on the Figma-generated React components.
 */

/* ==========================================================================
   CSS Variables & Base
   ========================================================================== */

.rd-roadmap {
    --rd-font-family: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Colors */
    --rd-color-text-primary: #403b3b;
    --rd-color-text-secondary: #767676;
    --rd-color-text-muted: #a3a3a3;
    --rd-color-link: #0064e5;
    --rd-color-link-hover: #0052c2;
    
    /* Phase colors */
    --rd-color-planning: #414e8e;
    --rd-color-next: #7baed4;
    --rd-color-delivered: #8AC5A8;
    
    /* Platform tag colors */
    --rd-color-ios-bg: #eaf7fd;
    --rd-color-ios-text: #206893;
    --rd-color-android-bg: #efffff;
    --rd-color-android-text: #307f7b;
    --rd-color-web-bg: #ffedfa;
    --rd-color-web-text: #c8279f;
    
    /* Background & Surface */
    --rd-color-bg: #f9f9f9;
    --rd-color-surface: #ffffff;
    --rd-color-border: #f0f0f0;
    --rd-color-border-light: #e0e0e0;
    
    /* Shadows */
    --rd-shadow-card: 0px 1px 10px 0px #f0f0f0;
    --rd-shadow-card-hover: 0px 2px 15px 0px #e0e0e0;
    --rd-shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Spacing */
    --rd-spacing-xs: 4px;
    --rd-spacing-sm: 8px;
    --rd-spacing-md: 16px;
    --rd-spacing-lg: 24px;
    --rd-spacing-xl: 32px;
    
    /* Border radius */
    --rd-radius-sm: 8px;
    --rd-radius-md: 10px;
    --rd-radius-lg: 16px;
    
    /* Typography */
    --rd-text-xs: 10px;
    --rd-text-sm: 12px;
    --rd-text-base: 14px;
    --rd-text-md: 16px;
    --rd-text-lg: 20px;
    --rd-text-xl: 24px;
    --rd-text-2xl: 28px;
    
    font-family: var(--rd-font-family);
    background-color: var(--rd-color-bg);
    color: var(--rd-color-text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.rd-roadmap *,
.rd-roadmap *::before,
.rd-roadmap *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Header
   ========================================================================== */

.rd-header {
    background-color: var(--rd-color-surface);
    box-shadow: var(--rd-shadow-card);
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
}

.rd-header-inner {
    max-width: 1299px;
    width: 100%;
    margin: 0 auto;
    padding: var(--rd-spacing-lg) var(--rd-spacing-xl) 0;
}

.rd-header-top {
    margin-bottom: var(--rd-spacing-sm);
}

.rd-header-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
    height: auto;
    min-height: 60px; /* Match logo height */
    flex-wrap: wrap;
}

.rd-logo {
    height: 60px; /* Increased to match text height */
    max-height: 60px;
    width: auto;
    max-width: 300px;
    flex-shrink: 0;
    object-fit: contain;
    display: block;
}

/* Force constraint on img tag specifically if used */
img.rd-logo {
    height: 60px !important;
    width: auto !important;
}

.rd-title {
    font-family: var(--rd-font-family);
    font-weight: 600;
    font-size: var(--rd-text-xl); /* 24px */
    color: var(--rd-color-text-primary);
    white-space: nowrap;
    margin: 0;
    line-height: 1; /* Match logo height exactly */
    display: flex;
    align-items: center;
    height: 60px; /* Match logo height */
}

.rd-subtitle {
    font-family: var(--rd-font-family);
    font-weight: 400;
    font-size: var(--rd-text-base); /* Reduced from md (16px) to base (14px) */
    color: var(--rd-color-text-primary);
    line-height: 1.5;
    padding-bottom: var(--rd-spacing-lg);
    margin: 0;
    max-width: 800px;
}

/* ==========================================================================
   Main Content & Board
   ========================================================================== */

.rd-main {
    max-width: 1299px;
    width: 100%;
    margin: 0 auto;
    padding: var(--rd-spacing-xl);
    overflow-x: hidden; /* Prevent horizontal scroll on body */
}

.rd-board {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--rd-spacing-lg);
    width: 100%;
    align-items: stretch;
}

@media (min-width: 1024px) {
    .rd-board {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-rows: 1fr; /* Force equal row heights */
        align-items: stretch;
    }
    
    .rd-board > .rd-lane {
        min-height: 100%;
        display: flex;
        flex-direction: column;
    }
}

/* ==========================================================================
   Lanes
   ========================================================================== */

.rd-lane {
    display: flex;
    flex-direction: column;
    background-color: var(--rd-color-bg);
    border-radius: var(--rd-radius-sm);
    padding-bottom: var(--rd-spacing-md);
}

.rd-lane-header {
    padding: var(--rd-spacing-sm);
    margin-bottom: var(--rd-spacing-sm);
}

.rd-lane-title {
    font-family: var(--rd-font-family);
    font-weight: 600;
    font-size: 18px; /* Reduced from lg (20px) */
    color: var(--rd-color-text-primary);
    line-height: 1.4;
    margin: 0 0 var(--rd-spacing-xs);
}

.rd-lane-description {
    font-family: var(--rd-font-family);
    font-weight: 400;
    font-size: var(--rd-text-sm); /* Reduced to 12px */
    color: var(--rd-color-text-secondary);
    line-height: 1.5;
    margin: 0;
}

.rd-lane-divider {
    height: 3px;
    border-radius: 1.5px;
    margin-bottom: var(--rd-spacing-sm);
}

.rd-lane-divider--planning {
    background-color: var(--rd-color-planning);
}

.rd-lane-divider--next {
    background-color: var(--rd-color-next);
}

.rd-lane-divider--delivered {
    background-color: var(--rd-color-delivered);
}

.rd-lane-cards {
    display: flex;
    flex-direction: column;
    gap: var(--rd-spacing-sm);
    flex: 1; /* Allow cards to fill available space */
}

.rd-empty-lane {
    font-family: var(--rd-font-family);
    font-size: var(--rd-text-base);
    color: var(--rd-color-text-muted);
    text-align: center;
    padding: var(--rd-spacing-xl);
    background: var(--rd-color-surface);
    border-radius: var(--rd-radius-sm);
}

/* ==========================================================================
   Cards
   ========================================================================== */

.rd-card {
    display: flex;
    align-items: stretch;
    box-shadow: var(--rd-shadow-card);
    cursor: pointer;
    transition: box-shadow 0.15s ease;
    border-radius: var(--rd-radius-sm);
    overflow: hidden;
}

.rd-card:hover {
    box-shadow: var(--rd-shadow-card-hover);
}

.rd-card:focus {
    outline: 2px solid var(--rd-color-link);
    outline-offset: 2px;
}

.rd-card-bar {
    width: 8px;
    flex-shrink: 0;
    border-radius: var(--rd-radius-sm) 0 0 var(--rd-radius-sm);
}

.rd-card-content {
    background-color: var(--rd-color-surface);
    flex: 1;
    padding: var(--rd-spacing-sm);
    display: flex;
    flex-direction: column;
    gap: var(--rd-spacing-sm);
    border-radius: 0 var(--rd-radius-sm) var(--rd-radius-sm) 0;
}

.rd-card-title {
    font-family: var(--rd-font-family);
    font-weight: 600;
    font-size: var(--rd-text-base); /* Reduced from md (16px) to 14px */
    color: var(--rd-color-planning);
    line-height: 1.4;
    margin: 0;
    
    /* Handle long text */
    white-space: normal; /* Allow wrapping */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Show max 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rd-card-description {
    font-family: var(--rd-font-family);
    font-weight: 400;
    font-size: var(--rd-text-sm);
    color: var(--rd-color-text-secondary);
    line-height: 1.5;
    margin: 0;
    
    /* Handle long text */
    white-space: normal; /* Allow wrapping */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Show max 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   Platform Tags
   ========================================================================== */

.rd-card-platforms,
.rd-modal-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: var(--rd-spacing-xs);
    align-items: center;
}

.rd-platform-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--rd-radius-sm);
    font-family: var(--rd-font-family);
    font-weight: 600;
    font-size: var(--rd-text-sm);
    line-height: 1.5;
    white-space: nowrap;
}

.rd-platform-tag--ios {
    background-color: var(--rd-color-ios-bg);
    color: var(--rd-color-ios-text);
}

.rd-platform-tag--android {
    background-color: var(--rd-color-android-bg);
    color: var(--rd-color-android-text);
}

.rd-platform-tag--web {
    background-color: var(--rd-color-web-bg);
    color: var(--rd-color-web-text);
}

/* ==========================================================================
   Product Goal Tag
   ========================================================================== */

.rd-product-goal {
    display: inline-flex;
    align-items: stretch;
    border-radius: var(--rd-radius-sm);
}

.rd-product-goal-category {
    display: flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--rd-radius-sm) 0 0 var(--rd-radius-sm);
    font-family: var(--rd-font-family);
    font-weight: 700;
    font-size: var(--rd-text-sm);
    color: #ffffff;
    line-height: 1.5;
    white-space: nowrap;
}

.rd-product-goal-theme {
    display: flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 0 var(--rd-radius-sm) var(--rd-radius-sm) 0;
    border: 1px solid;
    border-left: none;
    font-family: var(--rd-font-family);
    font-weight: 400;
    font-size: var(--rd-text-sm);
    color: var(--rd-color-text-primary);
    line-height: 1.5;
    white-space: nowrap;
    background: var(--rd-color-surface);
}

/* ==========================================================================
   Card Footer
   ========================================================================== */

.rd-card-divider {
    height: 1px;
    background-color: var(--rd-color-border);
    width: 100%;
}

.rd-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rd-view-details {
    display: flex;
    align-items: center;
    gap: var(--rd-spacing-xs);
    font-family: var(--rd-font-family);
    font-weight: 400;
    font-size: var(--rd-text-sm);
    color: var(--rd-color-text-muted);
    line-height: 1.5;
}

/* ==========================================================================
   Vote Button
   ========================================================================== */

.rd-vote-button {
    display: inline-flex;
    align-items: center;
    gap: var(--rd-spacing-sm);
    padding: 7px;
    background-color: var(--rd-color-bg);
    border: none;
    border-radius: var(--rd-radius-sm);
    cursor: pointer;
    transition: background-color 0.15s ease;
    font-family: var(--rd-font-family);
    font-weight: 400;
    font-size: var(--rd-text-md);
    color: #403b3b; /* Dark color for icon via currentColor */
    line-height: 1.5;
}

.rd-vote-button:hover {
    background-color: #eeeeee;
}

.rd-vote-button:focus {
    outline: 2px solid var(--rd-color-link);
    outline-offset: 2px;
}

.rd-vote-button--large {
    background-color: var(--rd-color-link);
    color: #ffffff !important; /* White text and icon color via currentColor */
    padding: 8px 16px;
    font-weight: 600;
    font-size: var(--rd-text-lg);
}

/* Vote display (non-button) styling for delivered items */
.rd-vote-display {
    display: inline-flex;
    flex-direction: row; /* Ensure horizontal layout */
    align-items: center;
    gap: var(--rd-spacing-sm);
    padding: 7px;
    font-family: var(--rd-font-family);
    font-weight: 400;
    font-size: var(--rd-text-md);
    color: #403b3b;
    line-height: 1.5;
}

.rd-vote-display .rd-icon {
    flex-shrink: 0;
}

.rd-vote-display .rd-vote-count {
    display: inline;
}

.rd-vote-display--large {
    display: inline-flex;
    flex-direction: row; /* Ensure horizontal layout */
    align-items: center;
    gap: var(--rd-spacing-sm);
    background-color: var(--rd-color-link);
    color: #ffffff !important; /* White for icon via currentColor */
    padding: 8px 16px;
    font-weight: 600;
    font-size: var(--rd-text-lg);
    border-radius: var(--rd-radius-sm);
}

.rd-vote-button--large:hover {
    background-color: var(--rd-color-link-hover);
}

.rd-vote-button--voted {
    opacity: 0.7;
    cursor: default;
    position: relative;
}

/* No hover effect for voted buttons */
.rd-vote-button--voted:hover {
    opacity: 0.7;
    background-color: var(--rd-color-bg);
    transform: none;
}

.rd-vote-button--large.rd-vote-button--voted {
    opacity: 0.7;
}

.rd-vote-button--large.rd-vote-button--voted:hover {
    opacity: 0.7;
    background-color: var(--rd-color-link);
    transform: none;
}

/* Tooltip container - added via JS */
.rd-tooltip {
    position: fixed;
    background-color: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: var(--rd-font-family);
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    z-index: 99999;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.rd-tooltip.rd-tooltip--visible {
    opacity: 1;
}

/* Arrow for tooltip - pointing down (tooltip above button) */
.rd-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
}

/* Arrow pointing up (tooltip below button) */
.rd-tooltip.rd-tooltip--below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #333;
}

/* Disabled state (for delivered items) */
.rd-vote-button--disabled,
.rd-vote-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.rd-vote-button--disabled:hover,
.rd-vote-button:disabled:hover {
    opacity: 0.5;
    transform: none;
    background-color: var(--rd-color-bg);
}

.rd-vote-count {
    white-space: nowrap;
}

/* Duplicate rules removed - see Vote Button section above */

/* ==========================================================================
   Icons
   ========================================================================== */

.rd-icon {
    display: block;
    flex-shrink: 0;
}

.rd-icon-thumbup {
    width: 20px;
    height: 20px;
}

.rd-icon-arrow {
    width: 16px;
    height: 16px;
}

.rd-icon-close {
    width: 12px;
    height: 12px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.rd-footer {
    background-color: var(--rd-color-surface);
    box-shadow: var(--rd-shadow-card);
    margin-top: 64px;
}

.rd-footer-text {
    max-width: 1299px;
    margin: 0 auto;
    padding: var(--rd-spacing-lg) var(--rd-spacing-xl);
    text-align: center;
    font-family: var(--rd-font-family);
    font-weight: 400;
    font-size: var(--rd-text-md);
    color: var(--rd-color-text-primary);
    line-height: 1.5;
}

.rd-footer-link {
    font-weight: 600;
    color: var(--rd-color-link);
    text-decoration: none;
}

.rd-footer-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Modal
   ========================================================================== */

.rd-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--rd-spacing-md);
}

.rd-modal.rd-hidden {
    display: none;
}

.rd-modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.rd-modal-container {
    position: relative;
    background-color: var(--rd-color-surface);
    border-radius: var(--rd-radius-lg);
    box-shadow: var(--rd-shadow-modal);
    max-width: 42rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.rd-modal-header {
    position: relative;
    padding: var(--rd-spacing-lg);
    border-bottom: 1px solid var(--rd-color-border);
}

.rd-modal-close {
    position: absolute;
    right: var(--rd-spacing-lg);
    top: var(--rd-spacing-lg);
    padding: var(--rd-spacing-sm);
    background: transparent;
    border: none;
    border-radius: var(--rd-radius-sm);
    cursor: pointer;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff; /* Set default color to white as requested */
}

.rd-modal-close svg path {
    stroke: currentColor; /* Inherit color from parent */
}

.rd-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1); /* Subtle hover for dark/blue background */
}

.rd-modal-close:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.rd-modal-title {
    font-family: var(--rd-font-family);
    font-weight: 600;
    font-size: var(--rd-text-xl);
    color: var(--rd-color-planning);
    line-height: 1.5;
    padding-right: 48px;
    margin: 0;
}

.rd-modal-content {
    padding: var(--rd-spacing-lg);
}

.rd-modal-section {
    margin-bottom: var(--rd-spacing-lg);
}

.rd-modal-section:last-child {
    margin-bottom: 0;
}

.rd-modal-description {
    font-family: var(--rd-font-family);
    font-weight: 400;
    font-size: var(--rd-text-base);
    color: var(--rd-color-text-secondary);
    line-height: 1.6;
}

.rd-modal-description p {
    margin: 0 0 1em;
}

.rd-modal-description p:last-child {
    margin-bottom: 0;
}

.rd-modal-label {
    font-family: var(--rd-font-family);
    font-weight: 600;
    font-size: var(--rd-text-base);
    color: var(--rd-color-text-primary);
    line-height: 1.5;
    margin: 0 0 var(--rd-spacing-sm);
}

.rd-modal-delivery-date {
    font-family: var(--rd-font-family);
    font-weight: 400;
    font-size: var(--rd-text-base);
    color: var(--rd-color-text-secondary);
    margin: 0;
}

/* ==========================================================================
   Modal Vote Section
   ========================================================================== */

.rd-modal-vote-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--rd-spacing-md);
    border-top: 1px solid var(--rd-color-border);
    gap: var(--rd-spacing-md);
}

.rd-modal-vote-info {
    flex: 1;
}

.rd-modal-vote-title {
    font-family: var(--rd-font-family);
    font-weight: 600;
    font-size: var(--rd-text-md);
    color: var(--rd-color-text-primary);
    line-height: 1.5;
    margin: 0 0 var(--rd-spacing-xs);
}

.rd-modal-vote-subtitle {
    font-family: var(--rd-font-family);
    font-weight: 400;
    font-size: var(--rd-text-base);
    color: var(--rd-color-text-secondary);
    line-height: 1.5;
    margin: 0;
}

.rd-modal-vote-action {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rd-modal-vote-label {
    font-family: var(--rd-font-family);
    font-weight: 400;
    font-size: var(--rd-text-sm);
    color: var(--rd-color-text-primary);
    line-height: 1.5;
    margin: 0 0 var(--rd-spacing-xs);
}

/* ==========================================================================
   Vote Message
   ========================================================================== */

.rd-vote-message {
    margin-top: var(--rd-spacing-md);
    padding: var(--rd-spacing-sm) var(--rd-spacing-md);
    border-radius: var(--rd-radius-sm);
    font-family: var(--rd-font-family);
    font-size: var(--rd-text-sm);
    line-height: 1.5;
}

.rd-vote-message.rd-hidden {
    display: none;
}

.rd-vote-message--success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.rd-vote-message--error {
    background-color: #ffebee;
    color: #c62828;
}

.rd-vote-message--info {
    background-color: #e3f2fd;
    color: #1565c0;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.rd-hidden {
    display: none !important;
}

/* Body scroll lock when modal is open */
body.rd-modal-open {
    overflow: hidden;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .rd-header-inner {
        padding: var(--rd-spacing-md) var(--rd-spacing-md) 0;
    }
    
    .rd-main {
        padding: var(--rd-spacing-md);
    }
    
    .rd-footer-text {
        padding: var(--rd-spacing-md);
    }
    
    .rd-modal-vote-section {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .rd-modal-vote-action {
        margin-top: var(--rd-spacing-md);
    }
}

@media (max-width: 480px) {
    .rd-header-title-row {
        flex-wrap: wrap;
    }
    
    .rd-title {
        font-size: var(--rd-text-lg);
    }
    
    .rd-card-title {
        white-space: normal;
    }
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.rd-vote-button.rd-loading {
    opacity: 0.7;
    pointer-events: none;
}

.rd-vote-button.rd-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: rd-spin 0.6s linear infinite;
}

@keyframes rd-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .rd-roadmap {
        background: white;
    }
    
    .rd-header {
        position: static;
        box-shadow: none;
        border-bottom: 1px solid #000;
    }
    
    .rd-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
    
    .rd-vote-button {
        display: none;
    }
    
    .rd-modal {
        display: none !important;
    }
    
    .rd-footer {
        box-shadow: none;
        border-top: 1px solid #000;
    }
}

