/*
 * Forge Business Info - Frontend Styles
 * Three-tier approach: inherit (default), preset, custom
 */

/* ==========================================================================
   BASE - Minimal structural styles, inherits everything from theme
   ========================================================================== */

.forgebi-widget {
    margin: 1em 0;
    line-height: 1.6;
    overflow: hidden;
}

.forgebi-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-bottom: 0.75em;
}

.forgebi-business-name {
    font-weight: 700;
    font-size: 1.2em;
}

/* Status badges */
.forgebi-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    font-size: 0.85em;
    font-weight: 500;
    padding: 0.15em 0.6em;
    border-radius: 999px;
    white-space: nowrap;
}

.forgebi-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.forgebi-status-open .forgebi-status-dot {
    background-color: #16a34a;
}
.forgebi-status-open {
    color: #15803d;
    background-color: rgba(22, 163, 74, 0.1);
}

.forgebi-status-closing .forgebi-status-dot {
    background-color: #d97706;
}
.forgebi-status-closing {
    color: #b45309;
    background-color: rgba(217, 119, 6, 0.1);
}

.forgebi-status-closed .forgebi-status-dot {
    background-color: #dc2626;
}
.forgebi-status-closed {
    color: #b91c1c;
    background-color: rgba(220, 38, 38, 0.1);
}

/* Location */
.forgebi-location {
    display: flex;
    align-items: flex-start;
    gap: 0.5em;
    margin-bottom: 0.5em;
}

.forgebi-icon {
    flex-shrink: 0;
    margin-top: 0.15em;
    opacity: 0.6;
    width: 16px;
    height: 16px;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.forgebi-icon-location {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
}

.forgebi-icon-phone {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
}

.forgebi-location-text {
    display: block;
}

.forgebi-map-link {
    display: block;
    font-size: 0.85em;
    margin-top: 0.35em;
}

/* Phone */
.forgebi-phone {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 0.75em;
}

.forgebi-phone-link {
    text-decoration: none;
}
.forgebi-phone-link:hover {
    text-decoration: underline;
}

/* Hours list */
.forgebi-hours {
    margin-top: 0.5em;
}

.forgebi-hours-list {
    width: 100%;
}

.forgebi-hours-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 0.35em 0;
}

.forgebi-hours-row .forgebi-day {
    font-weight: 500;
    white-space: nowrap;
    padding-right: 1em;
}

.forgebi-hours-row .forgebi-time {
    text-align: right;
}

/* When the row wraps (narrow container), time drops below day and aligns left */
.forgebi-hours-row .forgebi-time:only-child,
.forgebi-hours-row .forgebi-time {
    flex-grow: 1;
}

.forgebi-today .forgebi-day {
    font-weight: 700;
}

.forgebi-today-label {
    font-weight: 400;
    font-size: 0.8em;
    opacity: 0.7;
}

.forgebi-closed-text {
    opacity: 0.5;
    font-style: italic;
}

.forgebi-second-slot {
    font-size: 0.9em;
    opacity: 0.8;
}

/* Special hours */
.forgebi-special-hours {
    margin-top: 0.75em;
    padding-top: 0.75em;
    border-top: 1px solid rgba(128, 128, 128, 0.2);
}

.forgebi-special-heading {
    display: block;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
    margin-bottom: 0.4em;
}

.forgebi-special-entry {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    padding: 0.2em 0;
}

/* Credit */
.forgebi-credit {
    margin-top: 0.75em;
    padding-top: 0.5em;
    border-top: 1px solid rgba(128, 128, 128, 0.1);
    font-size: 0.75em;
    opacity: 0.5;
    text-align: right;
}

.forgebi-credit a {
    text-decoration: none;
}
.forgebi-credit a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Inline mode (status-only shortcode) */
.forgebi-inline {
    display: inline;
    margin: 0;
}

/* ==========================================================================
   PRESET: Card
   ========================================================================== */

.forgebi-preset-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25em 1.5em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   PRESET: Minimal List
   ========================================================================== */

.forgebi-preset-minimal {
    padding: 0;
    border-left: 3px solid currentColor;
    padding-left: 1em;
}

.forgebi-preset-minimal .forgebi-hours-row {
    padding: 0.2em 0;
}

.forgebi-preset-minimal .forgebi-credit {
    border-top: none;
    text-align: left;
}

/* ==========================================================================
   PRESET: Dark Panel
   ========================================================================== */

.forgebi-preset-dark {
    background: #1a1a2e;
    color: #e5e5e5;
    border-radius: 8px;
    padding: 1.25em 1.5em;
}

.forgebi-preset-dark .forgebi-business-name {
    color: #fff;
}

.forgebi-preset-dark a {
    color: #60a5fa;
}

.forgebi-preset-dark .forgebi-status-open {
    background-color: rgba(22, 163, 74, 0.2);
}

.forgebi-preset-dark .forgebi-status-closed {
    background-color: rgba(220, 38, 38, 0.2);
}

.forgebi-preset-dark .forgebi-status-closing {
    background-color: rgba(217, 119, 6, 0.2);
}

.forgebi-preset-dark .forgebi-special-hours {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.forgebi-preset-dark .forgebi-credit {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.forgebi-preset-dark .forgebi-credit a {
    color: #9ca3af;
}

.forgebi-preset-dark .forgebi-icon-location {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23e5e5e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
}

.forgebi-preset-dark .forgebi-icon-phone {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23e5e5e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
}

/* ==========================================================================
   PRESET: Compact Sidebar
   ========================================================================== */

.forgebi-preset-compact {
    font-size: 0.9em;
    padding: 0.75em;
    background: rgba(128, 128, 128, 0.04);
    border-radius: 6px;
}

.forgebi-preset-compact .forgebi-header {
    margin-bottom: 0.5em;
}

.forgebi-preset-compact .forgebi-business-name {
    font-size: 1em;
}

.forgebi-preset-compact .forgebi-hours-row {
    padding: 0.15em 0;
    font-size: 0.95em;
}

.forgebi-preset-compact .forgebi-location,
.forgebi-preset-compact .forgebi-phone {
    font-size: 0.9em;
    margin-bottom: 0.35em;
}

.forgebi-preset-compact .forgebi-special-hours {
    display: none; /* Too compact for specials */
}

/* ==========================================================================
   CUSTOM MODE - Uses CSS variables set via inline styles
   ========================================================================== */

.forgebi-custom {
    background: var(--forgebi-bg, #fff);
    color: var(--forgebi-text, #1f2937);
    border-radius: var(--forgebi-radius, 8px);
    font-size: var(--forgebi-font-size, 15px);
    padding: 1.25em 1.5em;
    border: 1px solid rgba(128, 128, 128, 0.15);
}

.forgebi-custom a {
    color: var(--forgebi-accent, #2563eb);
}

.forgebi-custom .forgebi-credit a {
    color: inherit;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 480px) {
    .forgebi-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25em;
    }

    .forgebi-hours-row .forgebi-time {
        text-align: left;
    }

    .forgebi-special-entry {
        flex-direction: column;
    }
}
