/* ========================================
   SMG OPENING HOURS WIDGET - 2025 DESIGN
   Verwendet einheitliche SMG Widget-Titel
   ======================================== */

.smg-opening-hours {
    --primary-color: var(--smg-500, #e31e24);
    --primary-hover: var(--smg-600, #c41e3a);
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --text-primary: var(--color-text-primary, #2c3e50);
    --text-secondary: var(--color-text-secondary, #6c757d);
    --background-card: var(--color-background-card, #ffffff);
    --border-color: var(--color-border, #e9ecef);
    --border-radius: var(--border-radius-md, 12px);
    --shadow-sm: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.1));
    --shadow-md: var(--shadow-md, 0 4px 16px rgba(0, 0, 0, 0.15));
    --transition: var(--transition-normal, all 0.3s ease);
}

/* ========================================
   BASE WIDGET STYLES
   ======================================== */
.smg-opening-hours {
    background: var(--background-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    max-width: var(--widget-max-width, 1400px);
    margin: 0 auto;
}

.smg-opening-hours:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Widget Header - Anpassungen für Öffnungszeiten Widget */
.smg-opening-hours .smg-widget-header {
    padding: clamp(1rem, 3vw, 1.5rem);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(227, 30, 36, 0.05) 0%, rgba(227, 30, 36, 0.02) 100%);
    text-align: left;
    margin-bottom: 0;
}

/* Opening Status */
.opening-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
    font-weight: 600;
}

/* Special Hours Notice */
.special-hours-notice {
    animation: slideInFromTop 0.4s ease-out;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.smg-opening-hours.has-special-hours .opening-hours-content {
    position: relative;
}

.smg-opening-hours.has-special-hours .opening-hours-content::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse 2s infinite;
}

.status-indicator.closing-soon {
    background: var(--warning-color);
}

.status-indicator.closed {
    background: var(--danger-color);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Content Area */
.opening-hours-content {
    padding: clamp(1rem, 3vw, 1.5rem);
}

/* ========================================
   CARD STYLE (Default)
   ======================================== */
.smg-opening-hours.style-card .hours-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.smg-opening-hours.style-card .day-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: 8px;
    background: rgba(248, 249, 250, 0.5);
    transition: var(--transition);
}

.smg-opening-hours.style-card .day-row:hover {
    background: rgba(227, 30, 36, 0.05);
    transform: translateX(4px);
}

.smg-opening-hours.style-card .day-row.today {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(227, 30, 36, 0.3);
}

.smg-opening-hours.style-card .day-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.smg-opening-hours.style-card .day-hours {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.smg-opening-hours.style-card .day-hours.closed {
    color: var(--danger-color);
    font-style: italic;
}

.smg-opening-hours.style-card .day-row.today .day-name,
.smg-opening-hours.style-card .day-row.today .day-hours {
    color: white;
}

/* ========================================
   COMPACT STYLE
   ======================================== */
.smg-opening-hours.style-compact .hours-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.smg-opening-hours.style-compact .hours-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid var(--primary-color);
    background: rgba(248, 249, 250, 0.7);
    border-radius: 0 6px 6px 0;
}

.smg-opening-hours.style-compact .group-days {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.smg-opening-hours.style-compact .group-hours {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.smg-opening-hours.style-compact .group-hours.closed {
    color: var(--danger-color);
    font-style: italic;
}

/* ========================================
   TABLE STYLE
   ======================================== */
.smg-opening-hours.style-table .hours-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.smg-opening-hours.style-table .hours-table tr {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.smg-opening-hours.style-table .hours-table tr:hover {
    background: rgba(227, 30, 36, 0.05);
}

.smg-opening-hours.style-table .hours-table tr.today {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
}

.smg-opening-hours.style-table .hours-table td {
    padding: 0.75rem;
    vertical-align: middle;
}

.smg-opening-hours.style-table .day-name {
    font-weight: 600;
    color: var(--text-primary);
}

.smg-opening-hours.style-table .day-hours {
    text-align: right;
    font-weight: 500;
    color: var(--text-secondary);
}

.smg-opening-hours.style-table .day-hours.closed {
    color: var(--danger-color);
    font-style: italic;
}

.smg-opening-hours.style-table tr.today .day-name,
.smg-opening-hours.style-table tr.today .day-hours {
    color: white;
}

/* ========================================
   MINIMAL STYLE
   ======================================== */
.smg-opening-hours.style-minimal .hours-minimal {
    text-align: center;
}

.smg-opening-hours.style-minimal .today-hours {
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.smg-opening-hours.style-minimal .today-label {
    font-weight: 600;
}

.smg-opening-hours.style-minimal .today-time {
    font-weight: 700;
}

.smg-opening-hours.style-minimal .today-time.closed {
    color: #ffcccb;
}

.smg-opening-hours.style-minimal .all-hours {
    margin-top: 1rem;
}

.smg-opening-hours.style-minimal .all-hours summary {
    cursor: pointer;
    padding: 0.5rem;
    background: rgba(248, 249, 250, 0.7);
    border-radius: 6px;
    font-weight: 600;
    color: var(--text-primary);
    transition: var(--transition);
}

.smg-opening-hours.style-minimal .all-hours summary:hover {
    background: rgba(227, 30, 36, 0.1);
}

.smg-opening-hours.style-minimal .all-hours[open] summary {
    margin-bottom: 1rem;
    background: var(--primary-color);
    color: white;
}

/* ========================================
   STATUS FOCUS STYLE
   ======================================== */
.smg-opening-hours.style-status-focus .hours-status-focus {
    text-align: center;
}

.smg-opening-hours.style-status-focus .status-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(227, 30, 36, 0.1) 0%, rgba(227, 30, 36, 0.05) 100%);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.smg-opening-hours.style-status-focus .status-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--success-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

.smg-opening-hours.style-status-focus .status-info {
    text-align: left;
}

.smg-opening-hours.style-status-focus .status-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.smg-opening-hours.style-status-focus .status-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.smg-opening-hours.style-status-focus .hours-summary {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

/* ========================================
   DIRECTORY STYLE (Center + Shops) - MODERNE TABELLE 2025
   ======================================== */

/* Widget-spezifische Anpassungen für Directory Style */
.smg-opening-hours.style-directory {
    background: transparent;
    box-shadow: none;
    border: none;
}

.smg-opening-hours.style-directory:hover {
    transform: none;
}

.smg-opening-hours.style-directory .smg-widget-header {
    background: transparent;
    border-bottom: none;
    padding: 0 0 1.5rem 0;
    text-align: center;
    justify-content: center;
}

.smg-opening-hours.style-directory .opening-hours-content {
    padding: 0;
}

/* Container */
.smg-opening-hours.style-directory .hours-directory-table {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Center Öffnungszeiten - Prominent */
.smg-opening-hours.style-directory .center-hours-section {
    background: linear-gradient(135deg, rgba(227, 30, 36, 0.08) 0%, rgba(227, 30, 36, 0.03) 100%);
    border: 2px solid rgba(227, 30, 36, 0.2);
    border-radius: 16px;
    padding: 1.75rem 2rem;
    box-shadow: 0 4px 12px rgba(227, 30, 36, 0.08);
}

.smg-opening-hours.style-directory .hours-section-title {
    margin: 0 0 1.25rem 0;
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--app-gray-900);
    letter-spacing: -0.02em;
    text-align: center;
}

.smg-opening-hours.style-directory .center-hours-display {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    align-items: stretch;
}

.smg-opening-hours.style-directory .center-hours-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.25rem;
    background: white;
    border-radius: 10px;
    border: 1px solid rgba(227, 30, 36, 0.1);
    transition: all 0.2s ease;
}

.smg-opening-hours.style-directory .center-hours-item:hover {
    border-color: rgba(227, 30, 36, 0.3);
    box-shadow: 0 2px 8px rgba(227, 30, 36, 0.1);
    transform: translateX(4px);
}

.smg-opening-hours.style-directory .center-days {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--app-gray-900);
    letter-spacing: -0.01em;
}

.smg-opening-hours.style-directory .center-times {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Shops Tabelle Section */
.smg-opening-hours.style-directory .shops-table-section {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

/* Tabellen Controls */
.smg-opening-hours.style-directory .table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: rgba(248, 249, 250, 0.5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    gap: 1rem;
}

.smg-opening-hours.style-directory .search-wrapper {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.smg-opening-hours.style-directory .table-search {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
}

.smg-opening-hours.style-directory .table-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(227, 30, 36, 0.08);
}

.smg-opening-hours.style-directory .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--app-gray-500);
    pointer-events: none;
}

.smg-opening-hours.style-directory .results-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--app-gray-600);
    white-space: nowrap;
}

/* Tabelle Wrapper */
.smg-opening-hours.style-directory .shops-table-wrapper {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

.smg-opening-hours.style-directory .shops-table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.smg-opening-hours.style-directory .shops-table-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
}

.smg-opening-hours.style-directory .shops-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.smg-opening-hours.style-directory .shops-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Tabelle Styles */
.smg-opening-hours.style-directory .shops-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.smg-opening-hours.style-directory .shops-table thead {
    background: rgba(248, 249, 250, 0.8);
    position: sticky;
    top: 0;
    z-index: 10;
}

.smg-opening-hours.style-directory .shops-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 700;
    color: var(--app-gray-900);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid rgba(227, 30, 36, 0.15);
}

.smg-opening-hours.style-directory .shops-table .col-shop {
    width: 30%;
}

.smg-opening-hours.style-directory .shops-table .col-category {
    width: 20%;
}

.smg-opening-hours.style-directory .shops-table .col-hours {
    width: 50%;
}

.smg-opening-hours.style-directory .shops-table tbody tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: background-color 0.2s ease;
}

.smg-opening-hours.style-directory .shops-table tbody tr:hover {
    background: rgba(227, 30, 36, 0.02);
}

.smg-opening-hours.style-directory .shops-table tbody tr:last-child {
    border-bottom: none;
}

.smg-opening-hours.style-directory .shops-table td {
    padding: 1rem 1.5rem;
    vertical-align: top;
}

/* Shop Name Cell */
.smg-opening-hours.style-directory .shop-name-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.2s ease;
}

.smg-opening-hours.style-directory .shop-name-link:hover {
    color: var(--primary-color);
}

.smg-opening-hours.style-directory .shop-name-link:hover .shop-name-cell {
    transform: translateX(4px);
}

.smg-opening-hours.style-directory .shop-name-cell {
    font-weight: 600;
    color: var(--app-gray-900);
    line-height: 1.4;
    transition: transform 0.2s ease;
}

.smg-opening-hours.style-directory .shop-name-link .shop-name-cell {
    color: inherit;
}

/* Category Badge */
.smg-opening-hours.style-directory .category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Hours List */
.smg-opening-hours.style-directory .hours-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.smg-opening-hours.style-directory .hours-item {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
}

.smg-opening-hours.style-directory .days-label {
    font-weight: 600;
    color: var(--app-gray-800);
    min-width: 70px;
    flex-shrink: 0;
}

.smg-opening-hours.style-directory .times-label {
    color: var(--app-gray-700);
}

.smg-opening-hours.style-directory .times-label.closed {
    color: var(--danger-color);
    font-weight: 600;
    font-style: italic;
}

.smg-opening-hours.style-directory .no-hours {
    color: var(--app-gray-500);
    font-style: italic;
}

/* Keine Ergebnisse */
.smg-opening-hours.style-directory .no-results {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--app-gray-600);
    font-size: 0.9375rem;
}

.smg-opening-hours.style-directory .no-shops-message {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--app-gray-600);
}

/* Responsive Tabelle */
@media (max-width: 1024px) {
    .smg-opening-hours.style-directory .shops-table .col-shop {
        width: 35%;
    }

    .smg-opening-hours.style-directory .shops-table .col-category {
        width: 25%;
    }

    .smg-opening-hours.style-directory .shops-table .col-hours {
        width: 40%;
    }
}

@media (max-width: 768px) {
    .smg-opening-hours.style-directory .table-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }

    .smg-opening-hours.style-directory .search-wrapper {
        max-width: none;
    }

    .smg-opening-hours.style-directory .results-count {
        text-align: center;
    }

    .smg-opening-hours.style-directory .center-hours-section {
        padding: 1.25rem 1.5rem;
    }

    .smg-opening-hours.style-directory .hours-section-title {
        font-size: 1.125rem;
    }

    .smg-opening-hours.style-directory .center-hours-item {
        padding: 0.75rem 1rem;
    }

    .smg-opening-hours.style-directory .center-days,
    .smg-opening-hours.style-directory .center-times {
        font-size: 1rem;
    }

    .smg-opening-hours.style-directory .shops-table th,
    .smg-opening-hours.style-directory .shops-table td {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .smg-opening-hours.style-directory .hours-item {
        flex-direction: column;
        gap: 0.25rem;
        align-items: flex-start;
    }

    .smg-opening-hours.style-directory .days-label {
        min-width: auto;
    }
}

@media (max-width: 640px) {
    /* Mobile: Stapel-Layout für Tabelle */
    .smg-opening-hours.style-directory .shops-table thead {
        display: none;
    }

    .smg-opening-hours.style-directory .shops-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 8px;
        overflow: hidden;
    }

    .smg-opening-hours.style-directory .shops-table tbody tr:hover {
        background: white;
    }

    .smg-opening-hours.style-directory .shops-table td {
        display: block;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    .smg-opening-hours.style-directory .shops-table td:last-child {
        border-bottom: none;
    }

    .smg-opening-hours.style-directory .shops-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--app-gray-700);
        display: block;
        margin-bottom: 0.375rem;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .smg-opening-hours.style-directory .col-shop::before {
        content: 'Shop';
    }

    .smg-opening-hours.style-directory .col-category::before {
        content: 'Kategorie';
    }

    .smg-opening-hours.style-directory .col-hours::before {
        content: 'Öffnungszeiten';
    }

    .smg-opening-hours.style-directory .center-hours-section {
        padding: 1rem 1.25rem;
    }

    .smg-opening-hours.style-directory .hours-section-title {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .smg-opening-hours.style-directory .center-hours-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.375rem;
        padding: 0.75rem 1rem;
    }

    .smg-opening-hours.style-directory .center-days,
    .smg-opening-hours.style-directory .center-times {
        font-size: 0.9375rem;
    }

    .smg-opening-hours.style-directory .table-controls {
        padding: 0.875rem;
    }
}

/* ========================================
   COLOR SCHEMES
   ======================================== */
.smg-opening-hours.color-green {
    --primary-color: #28a745;
    --primary-hover: #218838;
}

.smg-opening-hours.color-blue {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
}

.smg-opening-hours.color-neutral {
    --primary-color: #6c757d;
    --primary-hover: #545b62;
}

/* ========================================
   RESPONSIVE DESIGN (Andere Styles)
   ======================================== */
@media (max-width: 768px) {
    .smg-opening-hours .smg-widget-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .smg-opening-hours.style-card .day-row {
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    .smg-opening-hours.style-table .hours-table td {
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    .smg-opening-hours.style-status-focus .status-display {
        flex-direction: column;
        text-align: center;
    }

    .smg-opening-hours.style-status-focus .status-info {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .smg-opening-hours .smg-widget-header {
        padding: 1rem;
    }

    .opening-hours-content {
        padding: 1rem;
    }

    .smg-opening-hours.style-card .day-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .smg-opening-hours.style-compact .hours-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}
