/* --- Wrapper (Matches Stopwatch Theme) --- */
#cd-wrapper {
    font-family: 'Press Start 2P', monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background-color: #111827; /* Gray 900 */
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border: 2px solid #374151; /* Gray 700 */
    color: white;
    gap: 20px;
}

.hidden { display: none !important; }

/* --- Title Input --- */
.cd-title-input {
    background: transparent;
    border: none;
    border-bottom: 2px dashed #4b5563;
    color: #fbbf24; /* Amber */
    font-family: inherit;
    font-size: 1.2rem; /* Mobile default */
    text-align: center;
    width: 100%;
    padding: 10px;
    outline: none;
    transition: all 0.2s;
    text-transform: uppercase;
    line-height: 1.5;
}

.cd-title-input:focus {
    border-bottom-style: solid;
    border-color: #fbbf24;
}

.cd-title-input.locked {
    border-bottom: none;
    color: #fbbf24;
    cursor: default;
}

/* --- Display Area --- */
.cd-display-container {
    background-color: #000;
    border: 4px solid #333;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    text-align: center;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px; /* Spacing between groups */
}

/* Glass reflection effect */
.cd-display-container::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.05), transparent);
    pointer-events: none;
}

.cd-time-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cd-digit {
    font-size: 2rem; /* Mobile default */
    color: #00FFFF; /* Glitch Cyan */
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    line-height: 1;
    font-family: 'Press Start 2P', monospace, sans-serif; /* Use Courier for numbers to ensure fixed width feel */
    font-weight: bold;
}

.cd-label {
    font-size: 0.5rem;
    color: #6b7280;
    margin-top: 5px;
    font-family: 'Press Start 2P', monospace;
}

.cd-sep {
    font-size: 2rem;
    color: #4b5563;
    margin-top: -15px; /* Align with digits */
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.cd-subtitle {
    font-size: 0.7rem;
    color: #6b7280;
    text-transform: uppercase;
    text-align: center;
    min-height: 1.2em;
}

/* --- Setup Panel --- */
.cd-setup-panel {
    width: 100%;
    background-color: #1f2937;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #374151;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cd-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cd-input-group label {
    font-size: 0.6rem;
    color: #9ca3af;
}

.cd-input {
    background-color: #111827;
    border: 2px solid #4b5563;
    color: white;
    font-family: 'Press Start 2P', monospace, sans-serif;
    font-size: 1rem;
    padding: 10px;
    border-radius: 4px;
    outline: none;
    color-scheme: dark; /* Ensures calendar picker is dark mode */
}

.cd-input:focus {
    border-color: #3b82f6;
}

/* --- Active Panel (Share) --- */
.cd-active-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cd-share-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

/* --- Buttons --- */
.cd-btn {
    width: 100%;
    padding: 15px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 0 4px 0 rgba(0,0,0,0.5);
}

.cd-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

.cd-btn.start {
    background-color: #10b981; /* Green */
    color: #064e3b;
    border-bottom: 4px solid #059669;
}

.cd-btn-small {
    padding: 10px 5px;
    font-family: inherit;
    font-size: 0.6rem;
    font-weight: bold;
    text-transform: uppercase;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 0 3px 0 rgba(0,0,0,0.5);
    color: white;
}

.cd-btn-small:active {
    transform: translateY(3px);
    box-shadow: none;
}

.cd-btn-small.share { background-color: #3b82f6; border-bottom: 3px solid #2563eb; }
.cd-btn-small.gcal { background-color: #ea4335; border-bottom: 3px solid #b91c1c; } /* Google Red */
.cd-btn-small.ical { background-color: #6366f1; border-bottom: 3px solid #4338ca; } /* Indigo */

.cd-btn-text {
    background: none;
    border: none;
    color: #6b7280;
    font-family: inherit;
    font-size: 0.7rem;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 5px;
}

.cd-btn-text:hover { color: #fff; }

/* --- Responsive --- */
@media (min-width: 600px) {
    .cd-digit { font-size: 3rem; }
    .cd-display-container { gap: 15px; }
    .cd-title-input { font-size: 1.5rem; }
}

@media (max-width: 500px) {
    .cd-share-grid {
        grid-template-columns: 1fr;
    }
}