/* ClassZen - Widget Styles */

/* Clock Widget */
#clock-widget {
    top: 20px;
    right: 20px;
}

#clock-widget .widget-content {
    text-align: center;
    min-width: 140px;
}

.clock-time {
    font-size: 48px;
    font-weight: 300;
    letter-spacing: 2px;
    text-shadow: var(--text-shadow);
    line-height: 1;
}

.clock-date {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 4px;
}

/* Timer Widget */
#timer-widget {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

#timer-widget .widget-content {
    text-align: center;
    min-width: 200px;
}

.timer-display {
    font-size: 64px;
    font-weight: 200;
    letter-spacing: 4px;
    text-shadow: var(--text-shadow);
    font-variant-numeric: tabular-nums;
}

.timer-controls {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.timer-controls.hidden {
    display: none;
}

.timer-input {
    width: 60px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-color);
    text-align: center;
    font-size: 16px;
}

.timer-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#timer-widget[data-state="focused"] .timer-display {
    color: var(--warning-color);
    animation: pulse-glow 1s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 20px rgba(255, 213, 74, 0.5); }
    50% { text-shadow: 0 0 40px rgba(255, 213, 74, 0.8); }
}

/* Calendar Widget */
#calendar-widget {
    top: 20px;
    left: 20px;
}

#calendar-widget .widget-content {
    text-align: center;
    min-width: 100px;
}

.calendar-today {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.calendar-day {
    font-size: 48px;
    font-weight: 300;
    line-height: 1;
}

.calendar-month {
    font-size: 16px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.calendar-full {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-top: 12px;
    font-size: 12px;
}

.calendar-full.hidden {
    display: none;
}

.calendar-full .day-header {
    font-weight: 600;
    opacity: 0.7;
    padding: 4px;
}

.calendar-full .day {
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
}

.calendar-full .day:hover {
    background: rgba(255, 255, 255, 0.1);
}

.calendar-full .day.today {
    background: var(--accent-color);
    font-weight: 600;
}

.calendar-full .day.other-month {
    opacity: 0.3;
}

/* Agenda Widget */
#agenda-widget {
    bottom: 20px;
    left: 20px;
    max-width: 350px;
}

#agenda-widget .widget-content {
    min-width: 250px;
}

.agenda-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    margin-bottom: 8px;
}

.agenda-text {
    font-size: 16px;
    line-height: 1.6;
    min-height: 60px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    border-radius: 8px;
    outline: none;
    white-space: pre-wrap;
}

.agenda-text:focus {
    background: rgba(255, 255, 255, 0.1);
}

/* Name Picker Widget */
#namepicker-widget .widget-content {
    text-align: center;
    min-width: 180px;
}

.namepicker-result {
    font-size: 36px;
    font-weight: 500;
    padding: 16px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.namepicker-result.animating {
    animation: name-shuffle 0.1s ease infinite;
}

@keyframes name-shuffle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.namepicker-controls {
    margin-top: 12px;
}

.namepicker-controls.hidden {
    display: none;
}

.namepicker-names {
    width: 100%;
    height: 120px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-color);
    resize: none;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 8px;
}

.namepicker-names::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* QR Code Widget */
#qrcode-widget .widget-content {
    text-align: center;
    min-width: 180px;
}

.qrcode-display {
    padding: 16px;
    background: white;
    border-radius: 8px;
    display: inline-block;
    min-width: 128px;
    min-height: 128px;
}

.qrcode-display canvas {
    display: block;
}

.qrcode-display:empty::after {
    content: 'No QR Code';
    color: #666;
    font-size: 14px;
}

.qrcode-controls {
    margin-top: 12px;
}

.qrcode-controls.hidden {
    display: none;
}

.qrcode-url {
    width: 100%;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 14px;
    margin-bottom: 8px;
}

.qrcode-url::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Work Symbols Widget */
#worksymbols-widget .widget-content {
    padding: 12px;
}

.worksymbol-icons {
    display: flex;
    gap: 8px;
}

.worksymbol-btn {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.worksymbol-btn svg {
    width: 28px;
    height: 28px;
}

.worksymbol-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.worksymbol-btn.active {
    background: rgba(153, 217, 217, 0.25);
    border-color: var(--accent-color);
    color: var(--text-color);
}

/* Noise Meter Widget */
#noisemeter-widget .widget-content {
    padding: 12px 16px;
}

.noisemeter-bars {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 60px;
}

.noisemeter-bar {
    width: 12px;
    background: linear-gradient(to top, var(--success-color), var(--warning-color), var(--danger-color));
    border-radius: 2px;
    transition: height 0.1s ease;
    height: 10%;
}

.noisemeter-label {
    font-size: 12px;
    text-align: center;
    margin-top: 8px;
    opacity: 0.7;
}

#noisemeter-widget[data-state="focused"] .noisemeter-bar {
    box-shadow: 0 0 10px var(--danger-color);
}

/* Sound Effects Widget */
#soundeffects-widget .widget-content {
    padding: 12px;
}

.soundeffects-buttons {
    display: flex;
    gap: 8px;
}

.sound-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-btn svg {
    width: 24px;
    height: 24px;
}

.sound-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.sound-btn:active,
.sound-btn.playing {
    background: var(--accent-color);
    transform: scale(0.95);
}

/* Dice Roller Widget */
#dice-widget .widget-content {
    text-align: center;
    padding: 16px;
}

.dice-display {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dice-face {
    font-size: 48px;
    font-weight: 600;
    text-shadow: var(--text-shadow);
}

.dice-face.rolling {
    animation: dice-roll 0.1s linear infinite;
}

@keyframes dice-roll {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(10deg); }
    75% { transform: rotate(-10deg); }
    100% { transform: rotate(0deg); }
}

/* Traffic Light Widget */
#trafficlight-widget .widget-content {
    padding: 12px;
}

.trafficlight-lights {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 8px;
    border-radius: 20px;
}

.trafficlight-light {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.3;
}

.trafficlight-light.red {
    background: #ff4444;
    box-shadow: 0 0 0 rgba(255, 68, 68, 0);
}

.trafficlight-light.yellow {
    background: #ffbb33;
    box-shadow: 0 0 0 rgba(255, 187, 51, 0);
}

.trafficlight-light.green {
    background: #00C851;
    box-shadow: 0 0 0 rgba(0, 200, 81, 0);
}

.trafficlight-light.active {
    opacity: 1;
}

.trafficlight-light.red.active {
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.8);
}

.trafficlight-light.yellow.active {
    box-shadow: 0 0 20px rgba(255, 187, 51, 0.8);
}

.trafficlight-light.green.active {
    box-shadow: 0 0 20px rgba(0, 200, 81, 0.8);
}

.trafficlight-light:hover {
    transform: scale(1.1);
}

/* Drawing Tools Widget */
#drawing-widget {
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
}

#drawing-widget .widget-content {
    padding: 8px;
}

.drawing-tools {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.drawing-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawing-btn svg {
    width: 22px;
    height: 22px;
}

.drawing-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.drawing-btn.active {
    background: var(--accent-color);
}

.drawing-color {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
}

.drawing-color::-webkit-color-swatch-wrapper {
    padding: 4px;
}

.drawing-color::-webkit-color-swatch {
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.drawing-size {
    width: 40px;
    height: 80px;
    -webkit-appearance: slider-vertical;
    writing-mode: bt-lr;
    background: transparent;
}

/* Default positions for widgets not in default view */
#namepicker-widget {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

#qrcode-widget {
    bottom: 20px;
    right: 20px;
}

#worksymbols-widget {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

#noisemeter-widget {
    bottom: 100px;
    right: 20px;
}

#soundeffects-widget {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

#dice-widget {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#trafficlight-widget {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .clock-time {
        font-size: 36px;
    }

    .timer-display {
        font-size: 48px;
    }

    .calendar-day {
        font-size: 36px;
    }

    #agenda-widget {
        max-width: 250px;
    }

    .worksymbol-btn {
        width: 40px;
        height: 40px;
    }

    .worksymbol-btn svg {
        width: 22px;
        height: 22px;
    }
}
