.vaktija-container {
    max-width: min(1440px, 90vw); /* Increased from 1200px to 1440px, or 90% of viewport width */
    margin: 0 auto;
    padding: 15px;
    font-family: Arial, sans-serif;
    border-radius: 15px;
    overflow: hidden; /* Ensure content doesn't overflow rounded corners */
    background-color: transparent;
    color: #333;
    width: 100%; /* Add this to ensure full width */
}

.vaktija-wrapper {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px 20px;
    position: relative;
    overflow: hidden;
}

.vaktija-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--vaktija-bg-image);
    background-repeat: repeat;
    background-size: 200px auto;
    background-position: center;
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
}

/* Add this to check if the styles are being applied */
.vaktija-wrapper[style*="--vaktija-bg-image"] {
    position: relative;
}

.vaktija-wrapper[style*="--vaktija-bg-image"]::before {
    background-color: transparent;
}

.vaktija-wrapper > * {
    position: relative;
    z-index: 1;
}

.date-info {
    text-align: center;
    margin: 5px 0 10px; /* Changed from 10px 0 to 5px 0 10px - less space at top, keep bottom margin */
}

.weekday {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 6px;
    color: #333333;
}

.gregorian-date {
    font-size: 1.2em;
    margin-bottom: 5px;
}

.hijri-date {
    font-size: 1.1em;
    color: #666;
    margin-top: 6px;
}

.vaktija-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); /* More flexible grid */
    gap: 15px;
    align-items: stretch;
}

.vaktija-item {
    text-align: center;
    padding: 15px 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    border: 1px solid #ddd;
}

.vaktija-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.vaktija-name {
    font-weight: bold;
    margin-bottom: 8px;
}

.vaktija-time-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center align by default */
    font-size: 16px; /* Set explicit base font size */
}

.vaktija-time {
    font-size: 1.2em;
    color: #008348;
    font-weight: bold;
    text-align: center; /* Center align by default */
    line-height: 1.2;
}

/* Tablet Responsive */
@media (max-width: 1200px) {
    .vaktija-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .vaktija-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .vaktija-grid {
        grid-template-columns: 1fr;
    }
    
    .vaktija-item {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: center;
        text-align: left;
        padding: 12px 15px;
    }

    .vaktija-name {
        margin-bottom: 0;
    }

    .vaktija-time-wrapper {
        align-items: flex-end; /* Right align on mobile */
    }

    .vaktija-time {
        text-align: right; /* Right align on mobile */
    }

    .vaktija-wrapper {
        padding: 12px 15px; /* Slightly smaller padding on mobile */
    }
    
    .date-info {
        margin: 4px 0 8px; /* Even more compact on mobile */
    }

    .next-prayer-countdown {
        font-size: 0.7em;
        text-align: right; /* Right align on mobile */
    }
}

/* Current and next prayer highlighting */
.current-prayer, .next-prayer {
    border-width: 2px;
    border-style: solid;
}

/* Light theme (default) */
.vaktija-item {
    background: #f8f9fa;
    border: 1px solid #ddd;
}

.vaktija-name {
    color: #333;
    font-weight: bold;
}

.vaktija-time {
    color: #008348;
    font-weight: bold;
}

.gregorian-date {
    color: #333;
}

.hijri-date {
    color: #666;
}

/* Dark theme - Auto */
@media (prefers-color-scheme: dark) {
    .vaktija-container:not(.force-bright) .vaktija-wrapper {
        background: #1a1a1a;
    }

    .vaktija-container:not(.force-bright) .vaktija-item {
        background: #2d2d2d;
        border-color: #444;
    }

    .vaktija-container:not(.force-bright) .weekday,
    .vaktija-container:not(.force-bright) #date-picker,
    .vaktija-container:not(.force-bright) .nav-arrow-text,
    .vaktija-container:not(.force-bright) .vaktija-name {
        color: #ffffff;
    }

    .vaktija-container:not(.force-bright) .hijri-date {
        color: #b0b0b0;
    }

    .vaktija-container:not(.force-bright) .vaktija-time {
        color: #00b865;
    }

    .vaktija-container:not(.force-bright) .vaktija-wrapper::before {
        opacity: 0.18;
    }
}

/* Force dark theme */
.vaktija-container.force-dark .vaktija-wrapper {
    background-color: #1a1a1a;
}

.vaktija-container.force-dark .vaktija-wrapper::before {
    opacity: 0.18;
}

.vaktija-container.force-dark .vaktija-item {
    background: #2d2d2d;
    border-color: #444;
}

.vaktija-container.force-dark .weekday,
.vaktija-container.force-dark #date-picker,
.vaktija-container.force-dark .nav-arrow-text,
.vaktija-container.force-dark .vaktija-name {
    color: #ffffff;
}

.vaktija-container.force-dark .hijri-date {
    color: #b0b0b0;
}

.vaktija-container.force-dark .vaktija-time {
    color: #00b865;
}

.vaktija-container.force-dark .nav-arrow {
    background: rgba(0, 184, 101, 0.1) !important;
    border-color: rgba(0, 184, 101, 0.2) !important;
    color: #ffffff !important;
}

.vaktija-container.force-dark .nav-arrow:hover:not(:disabled) {
    background: rgba(0, 184, 101, 0.2) !important;
}

.vaktija-container.force-dark .nav-arrow:disabled {
    opacity: 0.5;
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Force bright theme */
.vaktija-container.force-bright .vaktija-wrapper {
    background: #ffffff !important;
}

.vaktija-container.force-bright .weekday,
.vaktija-container.force-bright #date-picker {
    color: #333333;
}

.vaktija-container.force-bright .hijri-date {
    color: #666666;
}

/* Date navigation styles */
.date-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 6px 0;
    position: relative;
    padding: 10px;
}

/* Date picker styles */
.date-picker-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    height: 32px;
}

#date-picker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    padding: 0; /* Remove any padding */
}

.date-display {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    font-size: 1.2em;
    color: inherit;
    text-align: center;
    min-width: 150px;
    cursor: pointer;
    user-select: none;
    line-height: 1;
    pointer-events: none; /* Allow clicks to pass through to date picker */
}

/* Make sure the calendar icon is clickable */
input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

/* Navigation button base styles */
.nav-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(0, 131, 72, 0.2);
    background: rgba(0, 131, 72, 0.1);
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
    flex-shrink: 0;
}

.nav-arrow-text {
    font-size: 1.8em;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile styles */
@media (max-width: 576px) {
    #date-picker {
        font-size: 1.1em;
        min-width: 120px;
    }

    .nav-arrow {
        width: 28px;
        height: 28px;
    }

    .nav-arrow-text {
        font-size: 1.6em;
    }
}

/* Hover effects */
.nav-arrow:hover:not(:disabled) {
    background: rgba(0, 131, 72, 0.2);
    transform: scale(1.1);
}

.nav-arrow:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Ramadan specific styles - using warm pastel colors */
.vaktija-item.suhur-time,
.vaktija-item.iftar-time {
    background-color: rgba(255, 166, 0, 0.1);
    border: 2px solid #FFA600;
    position: relative;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 166, 0, 0.15);
}

/* Dark theme - Ramadan times */
.vaktija-container.force-dark .vaktija-item.suhur-time,
.vaktija-container.force-dark .vaktija-item.iftar-time {
    background-color: rgba(255, 183, 51, 0.15) !important;
    border: 2px solid #FFB733 !important;
    box-shadow: 0 4px 12px rgba(255, 183, 51, 0.2) !important;
}

/* Hover effects for Ramadan times */
.vaktija-item.suhur-time:hover,
.vaktija-item.iftar-time:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(255, 166, 0, 0.2);
}

/* Glow effects for Ramadan times */
.vaktija-item.suhur-time::before,
.vaktija-item.iftar-time::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: rgba(255, 166, 0, 0.1);
    border-radius: inherit;
    z-index: -1;
    filter: blur(4px);
}

/* Dark theme glow effects for Ramadan times */
.vaktija-container.force-dark .vaktija-item.suhur-time::before,
.vaktija-container.force-dark .vaktija-item.iftar-time::before {
    background: rgba(255, 183, 51, 0.15) !important;
}

/* Dark theme mobile adjustments */
@media (max-width: 576px) {
    .vaktija-container.force-dark .nav-arrow.today {
        background: rgba(0, 184, 101, 0.15);
        border-color: rgba(0, 184, 101, 0.3);
    }
    
    .vaktija-container.force-dark .nav-arrow:active {
        background-color: rgba(0, 184, 101, 0.25);
    }
}

/* Dark theme adjustments */
.vaktija-container.force-dark #date-picker {
    background: #2d2d2d;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.1);
}

.vaktija-container.force-dark .weekday {
    color: #ffffff;
}

/* Next Prayer Widget */
.next-prayer-widget {
    background: rgba(0, 131, 72, 0.1);
    border: 1px solid #008348;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.next-prayer-label {
    color: #666;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.next-prayer-name {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.next-prayer-time {
    color: #008348;
    font-size: 1.4em;
    font-weight: bold;
}

.tomorrow-note {
    font-size: 0.7em;
    opacity: 0.8;
    margin-left: 5px;
}

/* Dark theme */
.vaktija-container.force-dark .next-prayer-widget {
    background: rgba(0, 184, 101, 0.1);
    border-color: #00b865;
}

.vaktija-container.force-dark .next-prayer-label {
    color: #b0b0b0;
}

.vaktija-container.force-dark .next-prayer-time {
    color: #00b865;
}

/* Next prayer highlighting - Light theme */
.vaktija-item.next-prayer {
    background: rgba(0, 131, 72, 0.15);
    border: 2px solid #008348;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 131, 72, 0.2);
    position: relative;
    z-index: 1;
}

.vaktija-item.next-prayer:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 131, 72, 0.25);
}

/* Next prayer highlighting - Dark theme */
.vaktija-container.force-dark .vaktija-item.next-prayer {
    background: rgba(0, 184, 101, 0.2) !important;
    border: 2px solid #00b865 !important;
    box-shadow: 0 4px 12px rgba(0, 184, 101, 0.25) !important;
}

.vaktija-container.force-dark .vaktija-item.next-prayer:hover {
    box-shadow: 0 6px 16px rgba(0, 184, 101, 0.3) !important;
}

/* Glow effect for next prayer */
.vaktija-item.next-prayer::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: rgba(0, 131, 72, 0.1);
    border-radius: inherit;
    z-index: -1;
    filter: blur(4px);
}

/* Dark theme glow effect */
.vaktija-container.force-dark .vaktija-item.next-prayer::before {
    background: rgba(0, 184, 101, 0.2) !important;
}

/* Compact Next Prayer Widget */
.next-prayer-widget-compact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: rgba(0, 131, 72, 0.1);
    border: 1px solid #008348;
    border-radius: 20px;
    font-size: 0.9em;
    white-space: nowrap;
}

.next-prayer-widget-compact .next-prayer-label {
    color: #666;
    margin: 0;
    font-size: 0.85em;
}

.next-prayer-widget-compact .next-prayer-name {
    font-size: 0.9em;
    margin: 0;
    font-weight: bold;
}

.next-prayer-widget-compact .next-prayer-time {
    color: #008348;
    font-size: 1em;
    font-weight: bold;
    margin: 0;
}

.next-prayer-widget-compact .tomorrow-note {
    font-size: 0.7em;
}

/* Dark theme */
.vaktija-container.force-dark .next-prayer-widget-compact {
    background: rgba(0, 184, 101, 0.1);
    border-color: #00b865;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .next-prayer-widget-compact {
        font-size: 0.8em;
        padding: 3px 10px;
    }
    
    .next-prayer-widget-compact .next-prayer-label {
        display: none; /* Hide label on very small screens */
    }
}

/* Dark theme adjustments */
.vaktija-container.force-dark .date-navigation {
    background: rgba(255, 255, 255, 0.03); /* Lighter background for dark theme */
}

#date-picker {
    position: relative;
}

#date-picker[data-display]:not(:focus) {
    color: transparent;
}

#date-picker[data-display]:not(:focus)::before {
    content: attr(data-display);
    position: absolute;
    left: 0;
    right: 0;
    color: inherit;
}

/* Dark theme styles */
.vaktija-container.force-dark .date-display {
    color: #ffffff;
}

/* Countdown styles */
.next-prayer-countdown {
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
    text-align: center; /* Center align by default */
}

/* Dark theme */
.vaktija-container.force-dark .next-prayer-countdown {
    color: #b0b0b0;
}

/* Compact widget countdown */
.next-prayer-widget-compact .next-prayer-countdown {
    font-size: 0.9em;
    margin-left: 8px;
}

@media (max-width: 576px) {
    .next-prayer-widget-compact .next-prayer-countdown {
        display: none; /* Hide countdown in compact mode on mobile */
    }
}

/* Next prayer countdown styles */
.vaktija-time-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center align by default */
}

.next-prayer-countdown {
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
    text-align: center; /* Center align by default */
}

.vaktija-container.force-dark .next-prayer-countdown {
    color: #b0b0b0;
}

@media (max-width: 576px) {
    .vaktija-time-wrapper {
        align-items: flex-end;
    }
    
    .next-prayer-countdown {
        font-size: 0.7em;
        text-align: right;
    }
}

.location-name {
    font-size: 1.6em;
    font-weight: bold;
    margin-bottom: 6px;
    color: #008348;
    margin-top: 0; /* Ensure no top margin */
}

.vaktija-container.force-dark .location-name {
    color: #00b865;
}

@media (max-width: 576px) {
    .location-name {
        font-size: 1.4em;
    }
    
    .date-info {
        margin: 4px 0 8px; /* Even more compact on mobile */
    }
    
    .weekday {
        margin-bottom: 4px;
    }
    
    .date-navigation {
        margin: 4px 0;
        padding: 8px;
    }
    
    .hijri-date {
        margin-top: 4px;
    }
}

/* Remove debug styling */
.debug-countdown {
    border: none;
    min-height: auto;
}

/* Add this to match countdown styling but without countdown functionality */
.jamah-time {
    composes: next-prayer-countdown;
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
    text-align: center;
}

/* Dark theme */
.vaktija-container.force-dark .jamah-time {
    color: #b0b0b0;
}

/* Mobile */
@media (max-width: 576px) {
    .jamah-time {
        font-size: 0.7em;
        text-align: right;
    }
}