/**
 * Moon Phase Widget Specific Styles
 * File: widgets/moon-phase/assets/moon-phase.css
 * Compatible with ATT main system
 */

/* Moon Phase Widget Specific Overrides */
.att-moon-phase-widget .att-widget-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 25px; 
    padding-bottom: 15px; 
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: 15px;
}
.att-moon-visual { text-align: center; font-size: 4rem; }
.att-moon-visual img { width: 14rem !important; height: 14rem !important; }
/* Date and Time Display */
.att-current-datetime {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  color: #e0e0e0;
  min-width: 180px;
  text-align: center;
}

.att-moon-calendar-popup .att-popup-content {margin: 25vh auto;} 
.att-moon-calendar-popup {z-index: 899;}

.att-current-date {
    font-weight: 600;
    color: #f39c12;
    margin-bottom: 2px;
    font-size: 13px;
}

.att-current-time {
    color: #3498db;
    font-family: monospace;
    font-size: 14px;
    font-weight: 500;
}

/* Location Selector */
.att-location-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    order: 3;
    justify-content: center;
}

.att-location-icon {
    font-size: 18px;
}

.att-location-text {
    color: #bbb;
}

.att-detect-location { 
    padding: 10px 12px; 
    background: rgba(255, 255, 255, 0.1); 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    border-radius: 5px; 
    color: #fff; 
    cursor: pointer; 
    transition: all 0.3s ease; 
    font-size: 12px !important; 
    text-transform: none !important; 
}

.att-detect-location:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.att-detect-location:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Moon Display Layout */
.att-moon-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
    margin-bottom: 25px;
}

/* Emoji Enhancement */
img.wp-smiley, img.emoji { 
    filter: drop-shadow(0px 0px 18px #ffffff70); 
}

.att-moon-visual {
    text-align: center;
    font-size: 4rem;
}

/* Canvas Styling */
#att-moon-canvas {
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

/* Moon Information */
.att-moon-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.att-phase-name {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #9b59b6;
}

.att-illumination,
.att-moon-age {
    font-size: 16px;
    color: #ccc;
}

.att-illumination span,
.att-moon-age span {
    color: #f39c12;
    font-weight: 600;
}

.att-moon-zodiac-sign {
    margin-top: 10px;
    font-size: 16px;
    color: #3498db;
}

.att-next-phases {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
}

.att-next-phases div {
    margin: 5px 0;
    color: #aaa;
}

.att-next-phases span {
    color: #3498db;
    font-weight: 500;
}

/* Meanings of the Moon Section */
.att-meanings-of-moon {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.att-meanings-of-moon h5 {
    margin: 0 0 10px 0;
    color: #f39c12 !important;
    font-size: 18px !important;
}

.att-phase-meaning-text {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #e0e0e0;
}

/* Calendar Specific Styles */
.att-moon-calendar {
    width: 100%;
    max-width: 500px;
}

.att-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.att-cal-prev,
.att-cal-next {
    background: rgba(243, 156, 18, 0.2);
    border: 1px solid #f39c12;
    color: #f39c12;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.att-cal-prev:hover,
.att-cal-next:hover {
    background: rgba(243, 156, 18, 0.4);
    transform: scale(1.1);
}

.att-cal-month-year {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #f39c12;
}

.att-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 10px;
}

.att-cal-weekday {
    text-align: center;
    padding: 8px;
    font-weight: 600;
    color: #9b59b6;
    font-size: 12px;
    background: rgba(155, 89, 182, 0.1);
    border-radius: 4px;
}

.att-cal-days {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;
}



.att-cal-day:not(.empty):hover {
    background: rgba(243, 156, 18, 0.2);
    border-color: #f39c12;
    transform: scale(1.05);
    z-index: 999;
}

.att-cal-day.today {
    background: rgba(231, 76, 60, 0.3);
    border-color: #e74c3c;
    font-weight: 700;
}

.att-cal-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.att-cal-day-number {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.att-cal-moon-emoji {
    font-size: 14px;
    margin: 2px 0;
}

.att-cal-illumination {
    font-size: 8px;
    color: #aaa;
    line-height: 1;
}

.att-calendar-legend {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    font-size: 11px;
    color: #aaa;
}

.att-calendar-legend span {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Embed Mode Adjustments */
.att-moon-phase-widget[data-embed="yes"] {
    max-width: none;
    margin: 0;
}

.att-moon-phase-widget[data-embed="yes"] .att-moon-display {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.att-moon-phase-widget[data-embed="yes"] #att-moon-canvas {
    width: 150px !important;
    height: 150px !important;
}

/* Keep location selector and date/time visible in embed mode */
.att-moon-phase-widget[data-embed="yes"] .att-location-selector {
    order: 3;
    width: 100%;
    justify-content: center;
    font-size: 12px;
    gap: 8px;
}

.att-moon-phase-widget[data-embed="yes"] .att-current-datetime {
    align-items: center;
    text-align: center;
    order: 2;
    min-width: auto;
    font-size: 12px;
}

.att-moon-phase-widget[data-embed="yes"] .att-current-date {
    font-size: 11px;
}

.att-moon-phase-widget[data-embed="yes"] .att-current-time {
    font-size: 11px;
}

/* Adjust layout for embed mode */
.att-moon-phase-widget[data-embed="yes"] .att-widget-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    margin-bottom: 20px;
}

.att-moon-phase-widget[data-embed="yes"] .att-widget-header h3 {
    font-size: 20px !important;
    margin-bottom: 5px;
}

/* Smaller detect location button in embed mode */
.att-moon-phase-widget[data-embed="yes"] .att-detect-location {
    padding: 8px 10px;
    font-size: 11px !important;
}

/* Responsive Design for Embeds */
@media (max-width: 450px) {
    .att-moon-phase-widget[data-embed="yes"] .att-moon-display {
        grid-template-columns: 1fr;
        gap: 15px;
        text-align: center;
    }
    
    .att-moon-phase-widget[data-embed="yes"] #att-moon-canvas {
        width: 120px !important;
        height: 120px !important;
        margin: 0 auto;
    }
    
    .att-moon-phase-widget[data-embed="yes"] .att-phase-name {
        font-size: 18px;
    }
    
    .att-moon-phase-widget[data-embed="yes"] .att-location-selector {
        flex-direction: column;
        gap: 5px;
    }
    
    .att-moon-phase-widget[data-embed="yes"] .att-meanings-of-moon {
        padding: 12px;
    }
    
    .att-moon-phase-widget[data-embed="yes"] .att-phase-meaning-text {
        font-size: 13px;
    }
}
@media (max-width: 768px) {
    .att-moon-phase-widget .att-widget-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }
    
    .att-current-datetime {
        align-items: center;
        text-align: center;
        order: 2;
    }
    
    .att-location-selector {
        order: 3;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .att-moon-display {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }
    
    #att-moon-canvas {
        width: 150px !important;
        height: 150px !important;
        margin: 0 auto;
    }
    
    .att-phase-name {
        font-size: 20px;
    }
    
    .att-location-selector {
        flex-direction: column;
        gap: 5px;
    }
    
    .att-moon-calendar {
        max-width: 100%;
    }
    
    .att-cal-day {
        padding: 2px;
    }
    
    .att-cal-day-number {
        font-size: 10px;
    }
    
    .att-cal-moon-emoji {
        font-size: 12px;
    }
    
    .att-calendar-legend {
        flex-direction: column;
        gap: 5px;
        align-items: center;
    }
    
    .att-current-datetime {
        font-size: 12px;
    }
    
    .att-current-date {
        font-size: 11px;
    }
    
    .att-current-time {
        font-size: 12px;
    }
}

@media (max-width: 400px) {
    .att-moon-phase-widget[data-embed="yes"] .att-moon-display {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 15px;
    }
    
    .att-moon-phase-widget[data-embed="yes"] #att-moon-canvas {
        width: 120px !important;
        height: 120px !important;
        margin: 0 auto;
    }
    
    .att-meanings-of-moon {
        padding: 15px;
    }
    
    .att-phase-meaning-text {
        font-size: 13px;
    }
}

/* Animation for moon phase changes */
@keyframes moonGlow {
    0%, 100% { 
        box-shadow: 
            0 0 20px rgba(255, 255, 255, 0.2),
            inset 0 0 20px rgba(0, 0, 0, 0.3);
    }
    50% { 
        box-shadow: 
            0 0 30px rgba(255, 255, 255, 0.4),
            inset 0 0 20px rgba(0, 0, 0, 0.3);
    }
}

#att-moon-canvas.updating {
    animation: moonGlow 2s ease-in-out infinite;
}

/* Accessibility */
.att-moon-phase-widget button:focus,
.att-moon-phase-widget select:focus {
    outline: 2px solid #f39c12;
    outline-offset: 2px;
}

.att-cal-day:focus {
    outline: 2px solid #f39c12;
    outline-offset: 1px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .att-moon-info > div {
        color: #fff;
    }
    
    .att-phase-meaning-text {
        color: #fff;
    }
    
    .att-cal-day {
        border-width: 2px;
    }
}

/* Print friendly */
@media print {
    .att-action-buttons,
    .att-embed-code-popup,
    .att-moon-calendar-popup {
        display: none !important;
    }
}

/**
 * Enhanced Moon Calendar Styles
 * Optional CSS to further improve the calendar appearance
 */

/* Calendar Container */
.att-moon-calendar {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 100%;
    margin: 0 auto;
}

/* Calendar Header */
.att-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 10px;
}

.att-cal-prev,
.att-cal-next {
    background: #4a90e2;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.att-cal-prev:hover,
.att-cal-next:hover {
    background: #357abd;
    transform: scale(1.1);
}

.att-cal-month-year {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
    text-align: center;
    flex: 1;
}

/* Calendar Grid */
.att-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 10px;
}

.att-cal-weekday {
    text-align: center;
    font-weight: 600;
    color: #666;
    padding: 8px 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.att-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

/* Calendar Day Cells */
.att-cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    padding: 4px;
    position: relative;
    transition: all 0.2s ease;
    min-height: 60px;
}

.att-cal-day:not(.empty) {
    cursor: pointer;
}

.att-cal-day:not(.empty):hover {
    background: linear-gradient(135deg, #4a90e2, #357abd) !important;
    color: white !important;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3) !important;
    border-color: #4a90e2 !important;
    z-index: 10;
}

.att-cal-day.today {
    border: 2px solid #4a90e2;
    background: linear-gradient(135deg, #9b9b9b, #0a1d2f);
    font-weight: bold;
}

.att-cal-day.today:hover {
    background: linear-gradient(135deg, #4a90e2, #357abd) !important;
    color: white !important;
}

.att-cal-day.empty {
    background: transparent;
    border: none;
    pointer-events: none;
}

/* Day Number */
.att-cal-day-number {
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 2px;
    order: 1;
}

/* Moon Emoji */
.att-cal-moon-emoji {
    font-size: 18px;
    line-height: 1;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
    order: 2;
}

.att-cal-day:hover .att-cal-moon-emoji {
    transform: scale(1.2);
}

/* Illumination Text */
.att-cal-illumination {
    font-size: 10px;
    opacity: 0.8;
    font-weight: 500;
    line-height: 1;
    order: 3;
}

.att-cal-day:hover .att-cal-illumination {
    opacity: 1;
    font-weight: 600;
}

/* Calendar Legend */
.att-calendar-legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.att-calendar-legend span {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Tooltip Enhancements */
.att-calendar-tooltip {
    animation: fadeInUp 0.2s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .att-moon-calendar {
        max-width: 350px;
    }
    
    .att-cal-day {
        min-height: 50px;
        padding: 2px;
    }
    
    .att-cal-moon-emoji {
        font-size: 16px;
    }
    
    .att-cal-day-number {
        font-size: 12px;
    }
    
    .att-cal-illumination {
        font-size: 9px;
    }
    
    .att-calendar-legend {
        gap: 10px;
    }
    
    .att-calendar-legend span {
        font-size: 11px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .att-cal-month-year {
        color: #e0e0e0;
    }
    
    .att-cal-weekday {
        color: #b0b0b0;
    }
    
    .att-cal-day {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .att-cal-day:not(.empty) {
        background: #333;
        border-color: #555;
    }
    
    .att-cal-day.today {
        background: linear-gradient(135deg, #1a3a5c, #2a4a6c);
        border-color: #4a90e2;
    }
    
    .att-calendar-legend {
        background: #2a2a2a;
    }
    
    .att-calendar-legend span {
        color: #b0b0b0;
    }
}

/* Accessibility Improvements */
.att-cal-day:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

.att-cal-day:focus:not(:hover) {
    background: #f0f7ff;
}

/* Print Styles */
@media print {
    .att-calendar-tooltip {
        display: none !important;
    }
    
    .att-cal-day:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}