/* Comparison page styles */
.font-slot {
    background: #fff;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
    flex: 1;
    min-width: 160px;
    margin: 0;
    overflow: hidden;
    transition: all 0.2s ease;
    display: none;
    flex-direction: column;
}

.font-slot:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.font-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    font-size: 24px;
    transition: font-size 0.3s ease, background-color 0.3s ease;
    flex-grow: 1;
    padding: 1rem;
    min-height: 120px;
}

.font-preview .preview-text {
    word-break: break-word;
    text-align: center;
    width: 100%;
    margin: 0;
    line-height: 1.2;
}

.font-preview .font-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: #666;
    margin: 0;
    text-align: center;
}

.font-size-control {
    display: flex;
    align-items: center;
}

.form-range {
    cursor: pointer;
}

/* Selected fonts summary styles */
.selected-fonts-summary {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    min-height: 38px;
}

.selected-fonts-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.font-badge {
    display: inline-flex;
    align-items: center;
    background-color: #eef0ff;
    border: 1px solid #d4d8ff;
    border-radius: 3px;
    padding: 2px 8px;
    margin-right: 5px;
    font-size: 12px;
    color: #5b6bf5;
    transition: all 0.2s ease;
}

.font-badge:hover {
    background-color: #d4d8ff;
}

.font-badge .remove-badge {
    margin-left: 5px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: #6c757d;
}

.font-badge .remove-badge:hover {
    color: #dc3545;
}

.no-fonts-message {
    color: #6c757d;
}

.compare-btn {
    color: #6c757d;
    transition: color 0.2s ease;
}

.compare-btn:hover {
    color: #5b6bf5;
}

.clear-font {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.clear-font:hover {
    opacity: 1;
}

#clear-all-fonts {
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

#clear-all-fonts:hover {
    background-color: #dc3545;
    color: white;
}

/* Responsive adjustments */
@media (max-width: 970px) {
    .font-preview {
        min-height: 40px;
        padding: 1rem;
    }
}

/* Animation for slot updates */
.font-preview {
    transition: background-color 0.3s ease;
}

.font-preview.updating {
    background-color: #e9ecef;
}

/* Empty state styling */
.font-preview:empty::before {
    content: "Select a font to compare";
    color: #6c757d;
    font-style: italic;
}

/* Font selection section */
.font-selection {
    margin-top: 2rem;
}

.font-selection .font-category {
    margin-bottom: 1.5rem;
}

.font-selection .font-category h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.5rem;
}

/* Font item styles */
.font-item {
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    border: 1px solid #e9ecef;
}

.font-item:hover {
    border-color: #5b6bf5 !important;
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.font-item.selected {
    animation: pulse 0.5s;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.font-item .preview {
    font-size: 18px;
    line-height: 1.2;
    margin-bottom: 8px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.font-item .font-name {
    color: #6c757d;
    font-size: 12px;
}

/* Compare button styles */
.compare-btn {
    padding: 0.25rem 0.5rem;
    border: none;
    background: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #6c757d;
    transition: color 0.2s ease;
}

.compare-btn:hover {
    color: #5b6bf5;
}

.compare-btn svg {
    width: 1rem;
    height: 1rem;
}

/* Font info styles */
.font-info {
    padding: 0.5rem;
    border-top: 1px solid #e9ecef;
    margin-top: 0.5rem;
}

.font-name {
    color: #a6b7c5;
    font-size: 0.5rem;
    text-transform: uppercase;
    font-weight: 800;
    padding: 10px;
}

/* Tooltip styles */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem;
    background-color: #000;
    color: #fff;
    font-size: 0.75rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

.font-item.active {
    border-color: #5b6bf5 !important;
    background-color: #eef0ff;
    box-shadow: 0 0 0 2px rgba(91, 107, 245, 0.3);
}

.font-item.active::after {
    content: "✓";
    position: absolute;
    top: 2px;
    right: 4px;
    color: #5b6bf5;
    font-size: 12px;
    font-weight: bold;
}

.sticky-section {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.textBox {
    background: white;
    margin: 0;
    padding: 0.5rem 0.5rem 0 0.5rem;
}

.comparison-container {
    background: white;
    padding: 0.5rem;
    margin: 0;
    border-radius: 0;
    overflow: visible;
    width: 100%;
}

.font-slots {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    padding: 0.5rem;
    margin: 0 -0.5rem;
    position: relative;
    width: calc(100% + 1rem);
}

.font-slot.active {
    display: flex;
}

.font-slot.selected {
    display: none;
}

.font-slot-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border-top: 1px solid #e9ecef;
    height: 44px;
}

.font-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: #666;
    margin: 0;
    padding: 0 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.button-group {
    display: flex;
    height: 100%;
}

.close-btn {
    background: white;
    border: none;
    border-left: 1px solid #e9ecef;
    border-radius: 0;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #dc3545;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 100%;
    min-width: 72px;
    justify-content: center;
}

.close-btn:hover {
    background: #dc3545;
    color: white;
}

.close-btn svg {
    width: 14px;
    height: 14px;
}

.copy-btn {
    background: white;
    border: none;
    border-left: 1px solid #e9ecef;
    border-radius: 0;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 100%;
    min-width: 72px;
    justify-content: center;
}

.copy-btn:hover {
    background: #f8f9fa;
    color: #5b6bf5;
}

.copy-btn.copied {
    background: #5b6bf5;
    color: white;
}

.copy-btn svg {
    width: 14px;
    height: 14px;
}

/* Mobile adjustments */
@media (max-width: 970px) {
    .font-slots {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 0;
        margin: 0;
        width: 100%;
    }

    .font-slot {
        width: 100%;
        margin: 0;
        background: white;
        box-shadow: none;
    }

    .font-slot:first-child {
        border-top-left-radius: 0.5rem;
        border-top-right-radius: 0.5rem;
    }

    .font-slot:last-child {
        border-bottom-left-radius: 0.5rem;
        border-bottom-right-radius: 0.5rem;
    }

    .font-preview {
        min-height: 40px;
        padding: 1rem;
    }

    .font-slot-footer {
        height: 44px;
    }

    .font-name {
        font-size: 0.75rem;
        padding: 0 8px;
    }

    .close-btn,
    .copy-btn {
        min-width: 64px;
        padding: 0 8px;
    }

    .button-group {
        gap: 0;
    }

    .preview-text {
        font-size: 0.875rem;
        line-height: 1.2;
        word-break: break-word;
        white-space: normal;
        padding: 0;
    }
}

.preview-text {
    word-break: break-word;
    text-align: center;
    width: 100%;
    margin: 0;
    line-height: 1.2;
    padding: 0;
}

/* Scale text based on length */
.preview-text[data-length="long"] {
    font-size: 0.875rem;
}

.preview-text[data-length="very-long"] {
    font-size: 0.75rem;
}

/* Special handling for fonts with decorations */
.preview-text[data-has-decorations="true"] {
    font-size: 0.875rem;
    letter-spacing: -0.02em;
}

/* Hide scrollbar but keep functionality */
.font-slots {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.font-slots::-webkit-scrollbar {
    display: none;
}

/* Remove the size control section */
.font-size-control {
    display: none;
}

/* Hide the clear all button when no fonts selected */
#clear-all-fonts {
    display: none;
}

.has-fonts #clear-all-fonts {
    display: inline-block;
}
