/**
 * ASMRC Legislative Tracker - Frontend Styles
 */

/* Bills List */
.asmrc-lt-bills-list {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.asmrc-lt-bill-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.asmrc-lt-bill-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.asmrc-lt-bill-number {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    font-weight: 700;
    color: #0073aa;
}

.asmrc-lt-bill-number a {
    color: #0073aa;
    text-decoration: none;
}

.asmrc-lt-bill-number a:hover {
    color: #005177;
    text-decoration: underline;
}

.asmrc-lt-bill-title {
    margin: 0 0 15px 0;
    font-size: 1em;
    font-weight: 600;
    color: #333;
}

.asmrc-lt-bill-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.asmrc-lt-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    background: #f0f0f0;
    color: #333;
}

/* Status color mapping for real LegInfo-style status strings */
/* Default chamber workflow statuses render blue unless overridden below. */
.asmrc-lt-status[class*="assembly"],
.asmrc-lt-status[class*="senate"],
.asmrc-lt-status[class*="committee"],
.asmrc-lt-status[class*="referral"],
.asmrc-lt-status[class*="appropriations"],
.asmrc-lt-status[class*="rules"],
.asmrc-lt-bill-status-badge[class*="assembly"],
.asmrc-lt-bill-status-badge[class*="senate"],
.asmrc-lt-bill-status-badge[class*="committee"],
.asmrc-lt-bill-status-badge[class*="referral"],
.asmrc-lt-bill-status-badge[class*="appropriations"],
.asmrc-lt-bill-status-badge[class*="rules"] {
    background: #e3f2fd;
    color: #1565c0;
}

.asmrc-lt-status[class*="died"],
.asmrc-lt-status[class*="failed"],
.asmrc-lt-status[class*="vetoed"],
.asmrc-lt-bill-status-badge[class*="died"],
.asmrc-lt-bill-status-badge[class*="failed"],
.asmrc-lt-bill-status-badge[class*="vetoed"] {
    background: #ffebee;
    color: #c62828;
}

.asmrc-lt-status[class*="chaptered"],
.asmrc-lt-status[class*="enacted"],
.asmrc-lt-status[class*="passed"],
.asmrc-lt-bill-status-badge[class*="chaptered"],
.asmrc-lt-bill-status-badge[class*="enacted"],
.asmrc-lt-bill-status-badge[class*="passed"] {
    background: #e8f5e9;
    color: #2e7d32;
}

.asmrc-lt-status.introduced {
    background: #e3f2fd;
    color: #1565c0;
}

.asmrc-lt-status.passed,
.asmrc-lt-status.enacted {
    background: #e8f5e9;
    color: #2e7d32;
}

.asmrc-lt-status.failed,
.asmrc-lt-status.vetoed {
    background: #ffebee;
    color: #c62828;
}

.asmrc-lt-status.in-committee {
    background: #fff3e0;
    color: #e65100;
}

.asmrc-lt-last-action {
    font-size: 0.9em;
    color: #666;
}

.asmrc-lt-date {
    font-size: 0.85em;
    color: #999;
    font-style: italic;
}

.asmrc-lt-bill-description {
    margin: 10px 0;
    line-height: 1.6;
    color: #555;
}

.asmrc-lt-bill-sponsors {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
}

.asmrc-lt-bill-sponsors strong {
    color: #333;
}

/* Bill Details Page */
.asmrc-lt-bill-details {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    margin: 20px 0;
}

.asmrc-lt-bill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #0073aa;
}

.asmrc-lt-bill-header h2 {
    margin: 0;
    color: #0073aa;
}

.asmrc-lt-bill-status-badge {
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.asmrc-lt-bill-details h3 {
    margin: 0 0 15px 0;
    font-size: 1.3em;
    color: #333;
}

.asmrc-lt-bill-details h4 {
    margin: 20px 0 10px 0;
    font-size: 1.1em;
    color: #0073aa;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.asmrc-lt-sponsors-section,
.asmrc-lt-last-action-section,
.asmrc-lt-votes-section {
    margin: 20px 0;
}

.asmrc-lt-sponsors-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.asmrc-lt-sponsors-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.asmrc-lt-party {
    color: #666;
    font-style: italic;
}

.asmrc-lt-sponsor-type {
    color: #999;
    font-size: 0.9em;
}

/* Vote Records */
.asmrc-lt-vote-record {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin: 10px 0;
}

.asmrc-lt-vote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.asmrc-lt-vote-result {
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85em;
}

.asmrc-lt-vote-result.passed {
    background: #e8f5e9;
    color: #2e7d32;
}

.asmrc-lt-vote-result.failed {
    background: #ffebee;
    color: #c62828;
}

.asmrc-lt-vote-description {
    margin: 10px 0;
    color: #666;
    font-size: 0.95em;
}

.asmrc-lt-vote-tally {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 10px;
    font-size: 0.9em;
}

.asmrc-lt-vote-tally span {
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: 600;
}

.asmrc-lt-yea {
    background: #e8f5e9;
    color: #2e7d32;
}

.asmrc-lt-nay {
    background: #ffebee;
    color: #c62828;
}

.asmrc-lt-nv,
.asmrc-lt-absent {
    background: #f5f5f5;
    color: #666;
}

/* Bill Links */
.asmrc-lt-bill-links {
    margin-top: 30px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.asmrc-lt-button {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.asmrc-lt-button:hover {
    background: #005177;
}

/* Member Bills */
.asmrc-lt-member-bills {
    margin: 20px 0;
}

.asmrc-lt-member-image-wrap {
    margin-bottom: 12px;
}

.asmrc-lt-member-image {
    width: 120px !important;
    height: 120px !important;
    border-radius: 9999px !important;
    object-fit: cover !important;
    border: 2px solid #e5e7eb;
    display: block;
}

.asmrc-lt-member-name {
    font-size: 1.5em;
    margin: 0 0 10px 0;
    color: #0073aa;
}

.asmrc-lt-bill-count {
    color: #666;
    margin: 0 0 20px 0;
}

/* Members Grid */
.asmrc-lt-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.asmrc-lt-member-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.asmrc-lt-member-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.asmrc-lt-member-card h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.asmrc-lt-member-district {
    color: #666;
    font-size: 0.9em;
    margin: 0;
}

/* Error & No Results */
.asmrc-lt-error {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #c62828;
}

.asmrc-lt-no-results {
    background: #fff3e0;
    color: #e65100;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #e65100;
}

/* Widget Styles */
.asmrc-lt-widget-bills {
    list-style: none;
    padding: 0;
    margin: 0;
}

.asmrc-lt-widget-bills li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.asmrc-lt-widget-bills li:last-child {
    border-bottom: none;
}

.asmrc-lt-widget-bills a {
    text-decoration: none;
    color: #333;
}

.asmrc-lt-widget-bills a:hover {
    color: #0073aa;
}

.asmrc-lt-widget-bills strong {
    color: #0073aa;
}

/* Fixed Side Calendar Pop-out */
.asmrc-lt-calendar-popout {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%) translateX(calc(-100% + 40px));
    width: 380px;
    max-width: calc(100vw - 24px);
    z-index: 9999;
    display: flex;
    flex-direction: row-reverse;
    align-items: stretch;
    transition: transform 0.28s ease;
    pointer-events: auto;
}

.asmrc-lt-calendar-popout:hover,
.asmrc-lt-calendar-popout:focus-within {
    transform: translateY(-50%) translateX(0);
}

.asmrc-lt-calendar-tab {
    background: #9b153f;
    color: #fff;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding: 14px 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    align-self: center;
}

.asmrc-lt-calendar-panel {
    width: 340px;
    background: #fff;
    border: 1px solid #d6d6d6;
    border-right: none;
    border-radius: 8px 0 0 8px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.asmrc-lt-calendar-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px 8px;
    border-bottom: 1px solid #e6e6e6;
    background: #f8f8f8;
    flex-wrap: wrap;
}

.asmrc-lt-calendar-controls label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.asmrc-lt-calendar-month-select {
    min-width: 130px;
    max-width: 170px;
    font-size: 13px;
    padding: 4px 6px;
}

.asmrc-lt-calendar-open-link {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    color: #0073aa;
}

.asmrc-lt-calendar-open-link:hover {
    text-decoration: underline;
}

.asmrc-lt-calendar-frame-wrap {
    height: 420px;
    background: #fff;
    overflow: auto;
    padding: 10px;
}

.asmrc-lt-calendar-grid {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.asmrc-lt-calendar-days-header,
.asmrc-lt-calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.asmrc-lt-calendar-day-label {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    padding: 6px 4px;
}

.asmrc-lt-calendar-day {
    min-height: 34px;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    padding: 4px;
}

.asmrc-lt-calendar-day:nth-child(7n) {
    border-right: none;
}

.asmrc-lt-calendar-day.is-empty {
    background: #fafafa;
}

.asmrc-lt-calendar-day-number {
    font-size: 12px;
    color: #334155;
}

.asmrc-lt-calendar-day.has-event {
    background: #fff6fa;
}

.asmrc-lt-calendar-day-dot {
    width: 7px;
    height: 7px;
    border-radius: 9999px;
    background: #9b153f;
    position: absolute;
    bottom: 5px;
    right: 5px;
}

.asmrc-lt-calendar-events {
    margin-top: 10px;
    border-top: 1px solid #e5e7eb;
    padding-top: 8px;
}

.asmrc-lt-calendar-event-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.asmrc-lt-calendar-event-item {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 8px;
    align-items: start;
    font-size: 12px;
    color: #1f2937;
    line-height: 1.35;
}

.asmrc-lt-calendar-event-day {
    background: #9b153f;
    color: #fff;
    font-weight: 700;
    border-radius: 4px;
    text-align: center;
    padding: 2px 0;
}

.asmrc-lt-calendar-events-empty {
    margin: 0;
    font-size: 12px;
    color: #64748b;
}

/* Responsive Design */
@media (max-width: 768px) {
    .asmrc-lt-bill-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .asmrc-lt-vote-header,
    .asmrc-lt-bill-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .asmrc-lt-members-grid {
        grid-template-columns: 1fr;
    }

    .asmrc-lt-calendar-popout {
        width: 92vw;
        transform: translateY(-50%) translateX(calc(-92vw + 44px));
    }

    .asmrc-lt-calendar-tab {
        font-size: 11px;
        padding: 10px 6px;
        letter-spacing: 0.2px;
    }

    .asmrc-lt-calendar-panel {
        width: calc(92vw - 44px);
    }

    .asmrc-lt-calendar-frame-wrap {
        height: 320px;
    }
}
