/* Theme variables */
:root {
    --bg-color: #ffffff;
    --text-color: #000;
    --border-color: #eee;
    --link-color: #000;
    --link-hover-color: #000;
    --secondary-text: #666;
    --accent-color: #333;
    --success-color: #4CAF50;
    --overlay-bg: rgba(255, 255, 255, 0.85);
}

.dark-mode {
    --bg-color: #111;
    --text-color: #fff;
    --border-color: #333;
    --link-color: #fff;
    --link-hover-color: #fff;
    --secondary-text: #999;
    --accent-color: #ddd;
    --success-color: #66BB6A;
    --overlay-bg: rgba(17, 17, 17, 0.85);
}

/* Base styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.5s ease, color 0.5s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--secondary-text);
}

/* Management mode styles */
.management-form {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-group {
    display: grid;
    gap: 0.5rem;
}

label {
    font-size: 0.95rem;
    color: var(--secondary-text);
}

input, select {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
    width: 100%;
    box-sizing: border-box;
}

button {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--text-color);
    color: var(--bg-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

button:hover {
    opacity: 0.9;
}

.url-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    display: none;
}

.url-display {
    font-family: monospace;
    padding: 0.75rem;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    margin-bottom: 1rem;
    word-break: break-all;
    color: var(--text-color);
}

.dark-mode .url-display {
    background-color: rgba(255, 255, 255, 0.1);
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.copy-success {
    color: var(--success-color);
    font-size: 0.9rem;
    margin-left: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.copy-success.visible {
    opacity: 1;
}

/* Countdown display styles */
.countdown-display {
    text-align: center;
    padding: 2rem 0;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    min-height: 300px;
}

.countdown-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.emoji-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.emoji-cell {
    position: absolute;
    display: block;
    user-select: none;
    pointer-events: none;
    text-align: center;
    z-index: 0;
}

.countdown-content {
    position: relative;
    z-index: 1;
    padding: 1rem;
    border-radius: 8px;
    background-color: var(--overlay-bg);
    margin: 0 auto;
    max-width: 90%;
}

.countdown-label {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.human-readable-time {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-text);
}

.countdown-digits {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.digit-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}

.digit {
    font-size: 3rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.digit-label {
    font-size: 0.8rem;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.countdown-expired {
    font-size: 2rem;
    font-weight: 600;
    margin-top: 2rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Button styles */
.edit-btn {
    background: transparent;
    color: var(--secondary-text);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.action-btn {
    background: var(--accent-color);
    color: var(--bg-color);
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.open-btn {
    background: var(--accent-color);
    color: var(--bg-color);
    margin-left: 0.5rem;
}

/* Button container styles */
.countdown-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.url-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.preview-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preview-label {
    font-size: 1rem;
    color: var(--secondary-text);
}

@media (max-width: 600px) {
    body {
        padding: 1rem;
    }

    .digit {
        font-size: 2.2rem;
    }

    .digit-group {
        min-width: 60px;
    }
}
