/**
 * Hito Time Square - Main Stylesheet
 * Lightweight, floating widget with modern design
 */

:root {
    --hito-primary: #6E6E73;
    --hito-primary-dark: #1D1D1F;
    --hito-bg: #ffffff;
    --hito-text: #1f2937;
    --hito-text-light: #6b7280;
    --hito-border: #e5e7eb;
    --hito-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    --hito-radius: 12px;
    --hito-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Floating Widget Container */
#hito-time-widget {
    position: fixed;
    z-index: 999999;
    cursor: pointer;
    user-select: none;
    /* No transition here — applied per-state only */
    top: 24px;
    right: 24px;
    bottom: auto;
    left: auto;
}

/* Minimized State - Floating Square Badge */
#hito-time-widget.minimized {
    width: 56px;
    height: 56px;
    background: #F9AA00;
    border-radius: 16px;
    box-shadow: var(--hito-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    /* Only transition visual properties, not geometry */
    transition: box-shadow 0.2s ease, border-radius 0.2s ease;
}

#hito-time-widget.minimized:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 30px -12px rgba(0, 0, 0, 0.2);
}

#hito-time-widget.minimized .hito-widget-icon {
    font-size: 28px;
    animation: hito-pulse 2s infinite;
}

#hito-time-widget.minimized .hito-widget-expanded {
    display: none;
}

/* Expanded State */
#hito-time-widget.expanded {
    width: 270px;
    height: 153px !important;
    background: var(--hito-bg);
    border-radius: var(--hito-radius);
    box-shadow: var(--hito-shadow);
    overflow: hidden;
    /* Only animate width — height grows naturally downward */
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s ease;
}
#hito-time-widget.expanded .hito-widget-icon {
    display: none;
}

#hito-time-widget.expanded .hito-widget-expanded {
    display: block;
}

/* Widget Header */
.hito-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--hito-primary), var(--hito-primary-dark));
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.hito-widget-title {
    font-size: 14px;
    letter-spacing: 0.5px;
}

.hito-widget-actions {
    display: flex;
    gap: 8px;
}

.hito-minimize-btn,
.hito-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.hito-minimize-btn:hover,
.hito-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Widget Content */
.hito-widget-content {
    padding: 20px;
    text-align: center;
}

/* Message Area */
.hito-message-area {
 //  background: #e5e5e5;
 // border: 1px solid #c5c5c5;
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 8px;
    font-size: 15px;
    color: #1D1D1F;
    word-wrap: break-word;
    animation: hito-slideDown 0.3s ease;
}

/* Time Display */
.hito-current-time {
    font-size: 28px;
    font-weight: 700;
    color: var(--hito-text);
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
}

.hito-date {
    font-size: 12px;
    color: var(--hito-text-light);
    margin-top: 1px;
}

/* Shortcode Styles */
.hito-shortcode-clock {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: var(--hito-bg);
    padding: 12px 20px;
    border-radius: var(--hito-radius);
    box-shadow: var(--hito-shadow);
}

.hito-shortcode-time {
    font-size: 24px;
    font-weight: 700;
    font-family: monospace;
}

.hito-shortcode-date {
    font-size: 12px;
    color: var(--hito-text-light);
}

.hito-shortcode-countdown {
    display: flex;
    gap: 12px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    padding: 16px 20px;
    border-radius: var(--hito-radius);
    color: white;
    justify-content: center;
    flex-wrap: wrap;
}

.hito-shortcode-countdown > div {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    min-width: 60px;
}

.hito-shortcode-countdown span {
    display: block;
    font-size: 10px;
    font-weight: 400;
    opacity: 0.7;
    margin-top: 4px;
    text-transform: uppercase;
}

.hito-shortcode-dispatch {
    background: #fef3c7;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hito-dispatch-label {
    font-weight: 600;
    color: #92400e;
}

.hito-dispatch-time {
    font-weight: 700;
    color: #b45309;
    font-family: monospace;
}

.hito-dispatch-message {
    color: #78350f;
}

/* Animations */
@keyframes hito-slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes hito-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes hito-fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.hito-fade-out {
    animation: hito-fadeOut 0.3s ease forwards;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #hito-time-widget.expanded {
        width: calc(100% - 32px);
        max-width: 320px;
        left: 16px !important;
        right: 16px !important;
    }
    
    .hito-current-time {
        font-size: 24px;
    }
    
    .hito-shortcode-countdown {
        gap: 8px;
        padding: 12px;
    }
    
    .hito-shortcode-countdown > div {
        font-size: 18px;
        min-width: 45px;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    .hito-minimize-btn,
    .hito-close-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    
    #hito-time-widget.minimized {
        width: 64px;
        height: 64px;
    }
    
    #hito-time-widget.minimized .hito-widget-icon {
        font-size: 32px;
    }
}

/* Draggable hint */
#hito-time-widget.minimized {
    cursor: grab;
}

#hito-time-widget.minimized:active {
    cursor: grabbing;
}