/* Retirement Countdown Module Styles */
/* Clean, self-contained styling for the countdown module with picture themes */

#countdown-container {
    position: relative;
    overflow: hidden;
    background-color: white;
    border-radius: 0.75rem;
    min-height: 200px;
}

/* Background layers for custom images */
#countdown-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.5s ease-in-out;
    z-index: 0;
    border-radius: 0.75rem;
}

#countdown-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    border-radius: 0.75rem;
}

#countdown-container.has-bg-image #countdown-bg-overlay {
    opacity: 1;
}

.countdown-content {
    position: relative;
    z-index: 2;
    padding: 1.5rem;
}

/* Title and Description */
#countdown-title {
    font-size: 1.875rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

#countdown-description {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

#countdown-description p {
    color: #4b5563;
    font-size: 0.875rem;
}

/* Countdown Grid */
.countdown-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    max-width: 450px;
    margin: 0 auto 1.5rem;
}

.countdown-box {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 1rem 0.5rem;
    border-radius: 0.5rem;
    text-align: center;
    border: 1px solid #e5e7eb;
    transition: transform 0.2s ease, background-color 0.5s ease;
}

.countdown-box:hover {
    transform: translateY(-2px);
}

.countdown-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: #374151;
    transition: transform 0.2s ease-out;
}

.countdown-number.flip {
    transform: scaleY(0);
}

.countdown-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
}

/* Congratulations Message */
#congrats-message {
    text-align: center;
    padding: 1rem;
    background-color: #d1fae5;
    border: 1px solid #6ee7b7;
    border-radius: 0.5rem;
}

#congrats-message h3 {
    font-size: 1.25rem;
    font-weight: bold;
    color: #065f46;
}

#congrats-message p {
    color: #047857;
    font-size: 0.875rem;
}

/* Settings Toggle Button */
#countdown-settings-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

#countdown-settings-toggle:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#countdown-settings-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.3s ease;
}

#countdown-settings-toggle.active svg {
    transform: rotate(45deg);
}

/* Settings Section */
.countdown-settings-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.countdown-settings-section.expanded {
    max-height: 2000px;
    opacity: 1;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease 0.1s;
}

.settings-section {
    margin-bottom: 1.5rem;
}

.settings-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1f2937;
}

/* Theme Picker */
.theme-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .theme-picker-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.theme-picker-btn {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    background-size: cover !important;
    background-position: center !important;
    position: relative;
    overflow: hidden;
}

.theme-picker-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.theme-picker-btn.active {
    border-color: #3b82f6;
    border-width: 3px;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Tooltip for theme names */
.theme-picker-btn:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10;
}

@media (max-width: 640px) {
    .theme-picker-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .theme-picker-btn {
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* Form Inputs */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    color: #374151;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Milestones */
#milestone-list {
    margin-bottom: 1rem;
}

.milestone-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.milestone-item:hover {
    background-color: #f9fafb;
}

.milestone-item p {
    margin: 0;
    font-size: 0.875rem;
    color: #1f2937;
}

.milestone-actions {
    display: flex;
    gap: 0.5rem;
}

.delete-milestone-btn {
    color: #ef4444;
    font-size: 0.875rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.delete-milestone-btn:hover {
    background-color: #fee2e2;
}

#add-milestone-btn {
    color: #3b82f6;
    font-size: 0.875rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.25rem;
    transition: all 0.2s;
}

#add-milestone-btn:hover {
    color: #2563eb;
}

#add-milestone-form {
    padding: 0.75rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    margin-top: 0.75rem;
}

#add-milestone-form input {
    margin-bottom: 0.5rem;
}

#add-milestone-form button {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

#save-milestone-btn {
    background-color: #3b82f6;
    color: white;
    border: none;
}

#save-milestone-btn:hover {
    background-color: #2563eb;
}

#cancel-milestone-btn {
    background-color: #e5e7eb;
    color: #4b5563;
    border: none;
    margin-left: 0.5rem;
}

#cancel-milestone-btn:hover {
    background-color: #d1d5db;
}

/* Background Upload */
label[for="bg-upload"] {
    color: #3b82f6;
    font-size: 0.875rem;
    cursor: pointer;
    transition: color 0.2s;
}

label[for="bg-upload"]:hover {
    color: #2563eb;
}

/* Setup Form */
#setup-form {
    text-align: center;
}

#setup-form h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1f2937;
}

#retirement-date-input {
    margin-bottom: 1rem;
}

#start-countdown-btn {
    width: 100%;
    padding: 0.5rem 1rem;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

#start-countdown-btn:hover {
    background-color: #2563eb;
}

/* When background image is applied */
#countdown-container.has-bg-image #countdown-title,
#countdown-container.has-bg-image h3,
#countdown-container.has-bg-image label {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

#countdown-container.has-bg-image .countdown-number {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

#countdown-container.has-bg-image .countdown-label {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

#countdown-container.has-bg-image .countdown-box {
    background-color: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}

#countdown-container.has-bg-image #countdown-description {
    background-color: rgba(0, 0, 0, 0.5);
    color: #ffffff;
}

#countdown-container.has-bg-image #countdown-description p {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

#countdown-container.has-bg-image .form-input {
    background-color: rgba(255, 255, 255, 0.9);
    color: #1f2937;
}

#countdown-container.has-bg-image .milestone-item p {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

#countdown-container.has-bg-image #add-milestone-btn,
#countdown-container.has-bg-image label[for="bg-upload"] {
    color: #fbbf24;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .countdown-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.25rem;
        max-width: 320px;
    }
    
    .countdown-box {
        padding: 0.375rem 0.125rem;
    }
    
    .countdown-number {
        font-size: 0.875rem;
        font-weight: 600;
    }
    
    .countdown-label {
        font-size: 0.375rem;
        margin-top: 0;
    }
    
    #countdown-settings-toggle {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.375rem;
        font-size: 0.75rem;
    }
    
    #countdown-settings-toggle svg {
        width: 1rem;
        height: 1rem;
    }
    
    #countdown-settings-toggle span {
        display: none;
    }
}

/* Tablet Responsive */
@media (min-width: 640px) and (max-width: 1023px) {
    .countdown-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.375rem;
        max-width: 400px;
    }
    
    .countdown-box {
        padding: 0.5rem 0.25rem;
    }
    
    .countdown-number {
        font-size: 1.125rem;
    }
    
    .countdown-label {
        font-size: 0.5rem;
    }
}

/* Color Themes (gradients only, no pictures - those come from uploads) */
.theme-default {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.theme-forest {
    background: linear-gradient(135deg, #062821 0%, #34d399 100%);
}

.theme-ocean {
    background: linear-gradient(135deg, #023047 0%, #219ebc 100%);
}

.theme-sunset {
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
}

.theme-mountain {
    background: linear-gradient(135deg, #3d4a5d 0%, #81a7a0 100%);
}

.theme-beach {
    background: linear-gradient(135deg, #0077be 0%, #ffc600 100%);
}

.theme-charcoal {
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
}

.theme-mardi {
    background: linear-gradient(135deg, #2a0d45 0%, #00a859 100%);
}

.theme-desert {
    background: linear-gradient(135deg, #4a2c2a 0%, #f0a500 100%);
}

.theme-gato {
    background: linear-gradient(135deg, #F6A9DB 0%, #F6C4A9 100%);
}
