/* 
 * HomeOps Dashboard Styles
 * Refined for 2-column Bento Grid
 */

body { 
    font-family: 'Inter', sans-serif; 
    background-color: #0f172a; 
}

/* Bento Card Glassmorphism Effect */
.bento-card { 
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 2.5rem; /* Consistent rounding for all widgets */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    min-height: 480px; /* Standardized height */
    overflow: hidden;
}

/* Lift effect for regular cards only */
.bento-card:not(.flip-card-front):not(.flip-card-back):hover { 
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-6px);
    box-shadow: 0 30px 60px -15px rgba(0,0,0,0.6);
}

/* Specialized hover for flip faces */
.flip-card:hover .flip-card-front,
.flip-card:hover .flip-card-back {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Power Status Pulse Animation */
.status-pulse {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Flip Card Container */
.flip-card {
    background-color: transparent;
    perspective: 2000px;
    height: 100%;
    min-height: 480px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: left;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    transform: rotateY(0deg) translateY(0px);
}

/* Explicit states for predictable 3D transitions */
.flip-card:hover .flip-card-inner {
    transform: rotateY(0deg) translateY(-8px);
    box-shadow: 0 30px 60px -15px rgba(0,0,0,0.6);
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg) translateY(0px);
}

.flip-card.flipped:hover .flip-card-inner {
    transform: rotateY(180deg) translateY(-8px);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 2.5rem; /* Match bento-card */
    transform: translateZ(0);
    transform-style: preserve-3d;
}

.flip-card-back {
    transform: rotateY(180deg) translateZ(0);
}

/* Layered 3D effect for contents */
.flip-card-front, .flip-card-back {
    display: flex;
    flex-direction: column;
    transform-style: preserve-3d;
}

.flip-card-front > div, .flip-card-back > div {
    transform: translateZ(20px);
    transform-style: preserve-3d;
}

.status-pulse, .calendar-icon {
    transform: translateZ(40px);
}

#power-title, #outage-next-time, #power-state-duration, .back-button {
    transform: translateZ(30px);
}

.schedule-list {
    transform: translateZ(10px);
}

/* Subtle shine effect on flip */
.flip-card-inner::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 2.5rem;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 50%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
    transform: translateZ(1px);
    opacity: 0;
    transition: opacity 0.8s;
}

.flip-card.flipped .flip-card-inner::after {
    opacity: 1;
}

/* Custom scrollbar for schedule list */
.schedule-list::-webkit-scrollbar {
    width: 4px;
}
.schedule-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
.schedule-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

@keyframes bounce-slow {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -10px); }
}

.animate-bounce-slow {
    animation: bounce-slow 3s ease-in-out infinite;
}
