/* Emotional Doors Component Styles */

/* Grid Layout */
.emotional-doors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

/* Individual Door Card */
.emotional-door {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    text-decoration: none;
    z-index: 1;
    will-change: transform, box-shadow, z-index;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .emotional-door {
        transition: none;
    }
}

/* Door Hover/Focus States */
.emotional-door:hover,
.emotional-door:focus {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--door-color, var(--primary-color));
    outline: none;
}

.emotional-door:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Door Icon */
.door-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.emotional-door:hover .door-icon {
    transform: scale(1.1);
}

/* Door Title */
.door-title {
    color: var(--door-color, var(--primary-color));
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
    font-weight: 600;
}

/* Door Description */
.door-description {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Door Overlay */
.door-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
}

.emotional-door:not(.preview-active):hover .door-overlay {
    opacity: 1;
}

/* Modal Styles */
.door-modal .modal-content {
    max-width: 800px;
    padding: 2rem;
    border-radius: var(--border-radius);
    background: var(--card-bg);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.door-modal .modal-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Door Header in Modal */
.door-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.door-header-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--door-color, var(--primary-color));
}

.door-subtitle {
    color: var(--text-muted);
    margin: 0.5rem 0 0;
    font-size: 1.1rem;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

/* Tool Card */
.tool-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tool-card:hover,
.tool-card:focus {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--door-color, var(--primary-color));
    outline: none;
}

.tool-card:active {
    transform: translateY(0);
}

/* Tool Icon */
.tool-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--door-color, var(--primary-color));
}

/* Tool Title */
.tool-title {
    margin: 0 0 0.5rem;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
}

/* Tool Description */
.tool-description {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Door Actions */
.door-actions {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Coming Soon Modal */
.coming-soon {
    text-align: center;
    padding: 1.5rem;
}

.coming-soon p {
    margin: 0 0 1rem;
    color: var(--text-color);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .emotional-doors-grid {
        grid-template-columns: 1fr;
        padding: 0 0.5rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .door-modal .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
        padding: 1.5rem;
    }
}

/* Dark Mode Adjustments */
/* Door Preview Styles */
.door-preview {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.3s ease forwards;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.door-preview.closing {
    animation: fadeOutDown 0.3s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

.preview-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.preview-icon {
    font-size: 2rem;
    margin-right: 1rem;
    line-height: 1;
}

.preview-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-color);
}

.preview-description {
    color: var(--text-muted);
    margin: 0 0 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
}

.tools-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.tool-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 4px solid var(--tool-color, var(--primary));
}

.tool-card:hover, .tool-card:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    outline: none;
    border-color: var(--tool-color, var(--primary));
}

.tool-icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    display: inline-block;
    color: var(--tool-color, var(--primary));
}

.tool-title {
    margin: 0 0 0.5rem;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.tool-description {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.close-preview {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
}

.close-preview:hover, .close-preview:focus {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
    outline: none;
}

/* Active state for door with preview */
.emotional-door.preview-active {
    z-index: 20;
    transform: scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Dark mode styles */
@media (prefers-color-scheme: dark) {
    .emotional-door {
        background: var(--card-bg-dark);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .emotional-door:hover {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    }
    
    .tool-card {
        background: var(--card-bg-dark);
        border-color: var(--border-color-dark);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: more) {
    .emotional-door {
        border: 2px solid var(--door-color, var(--primary-color));
    }
    
    .tool-card {
        border: 2px solid var(--door-color, var(--primary-color));
    }
    
    .emotional-door:focus,
    .tool-card:focus {
        outline: 3px solid var(--focus-color);
        outline-offset: 2px;
    }
}

/* Print Styles */
@media print {
    .emotional-door {
        break-inside: avoid;
        border: 1px solid #ddd;
        box-shadow: none;
        height: auto;
        min-height: 150px;
    }
    
    .door-overlay {
        display: none;
    }
    
    .tools-grid {
        display: block;
    }
    
    .tool-card {
        break-inside: avoid;
        margin-bottom: 1rem;
        border: 1px solid #eee;
        box-shadow: none;
    }
}
