/* Tool Page Styles */
.container {
    max-width: 1400px;
}

@media (max-width: 768px) {
    .container {
        padding-left: var(--spacing-xs);
        padding-right: var(--spacing-xs);
    }
}


.tool-breadcrumb {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.tool-breadcrumb a {
    color: var(--text-muted);
}

.tool-breadcrumb a:hover {
    color: var(--primary);
}

.tool-breadcrumb .current {
    color: var(--text-primary);
}

.tool-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    align-items: start;
}

.tool-main {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.tool-header {
    padding: 32px;
    border-bottom: 1px solid var(--border-color);
}

.tool-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.tool-header-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--tool-color) 15%, transparent);
    border-radius: 14px;
    color: var(--tool-color);
    flex-shrink: 0;
}

.tool-header-icon svg {
    width: 28px;
    height: 28px;
}

.tool-header-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.tool-header-actions {
    margin-left: auto;
}

/* Tool Dropdown (Three-Dot Menu) - Beautiful Dark Theme */
.tool-dropdown {
    position: relative;
}

.tool-dropdown-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(138, 80, 238, 0.1), rgba(200, 80, 192, 0.1));
    border: 1px solid rgba(138, 80, 238, 0.3);
    border-radius: 10px;
    color: var(--primary-light);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tool-dropdown-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), rgba(138, 80, 238, 0.5));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-dropdown-btn:hover {
    background: linear-gradient(135deg, rgba(138, 80, 238, 0.2), rgba(200, 80, 192, 0.2));
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(138, 80, 238, 0.3);
    transform: translateY(-2px);
}

.tool-dropdown-btn:hover::before {
    opacity: 0.1;
}

.tool-dropdown-btn svg {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
}

.tool-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 220px;
    background: hsl(230, 20%, 13%);
    border: 1px solid rgba(138, 80, 238, 0.3);
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(138, 80, 238, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.tool-dropdown-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(138, 80, 238, 0.5), transparent);
}

.tool-dropdown.active .tool-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.tool-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* .tool-dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    transform: translateX(-3px);
    transition: transform 0.2s ease;
} */

.tool-dropdown-item:hover::before {
    transform: translateX(0);
}

.tool-dropdown-item:hover {
    background: linear-gradient(90deg, rgba(138, 80, 238, 0.1), transparent);
    color: var(--text-primary);
}

.tool-dropdown-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.tool-dropdown-item:hover svg {
    color: var(--primary-light);
    transform: scale(1.1);
}

/* Special styling for Embed button - Make it stand out! */
.tool-dropdown-item:last-child {
    background: linear-gradient(135deg, rgba(138, 80, 238, 0.15), rgba(200, 80, 192, 0.1));
    border-top: 1px solid rgba(138, 80, 238, 0.2);
    color: var(--primary-light);
    font-weight: 600;
    margin-top: 4px;
}

.tool-dropdown-item:last-child::before {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(138, 80, 238, 0.2), rgba(200, 80, 192, 0.15));
    transform: translateX(0);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tool-dropdown-item:last-child:hover {
    background: linear-gradient(135deg, rgba(138, 80, 238, 0.25), rgba(200, 80, 192, 0.2));
    color: #fff;
    box-shadow: inset 0 0 20px rgba(138, 80, 238, 0.2);
}

.tool-dropdown-item:last-child:hover::before {
    opacity: 1;
}

.tool-dropdown-item:last-child svg {
    color: var(--primary-light);
}

.tool-dropdown-item:last-child:hover svg {
    color: #fff;
    filter: drop-shadow(0 0 8px rgba(138, 80, 238, 0.6));
}

.tool-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.tool-category-badge {
    display: inline-block;
    width: fit-content;
    padding: 6px 14px;
    background: color-mix(in srgb, var(--cat-color) 15%, transparent);
    color: var(--cat-color);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.tool-short-desc {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
}

.tool-content-wrapper {
    padding: 32px;
}

/* Tool Specific Styles */
.tool-container {
    max-width: 100%;
}

.tool-input-group {
    margin-bottom: 20px;
}

.tool-input-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    margin-top: var(--spacing-sm);
}

.tool-textarea,
.tool-input {
    width: 100%;
    padding: 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.2s;
    /* margin-top: var(--spacing-sm); */
}

.tool-textarea:focus,
.tool-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* File Input Styling */
.tool-input[type="file"] {
    padding: 10px;
    background: var(--bg-glass);
    border: 1px dashed var(--border-color);
    cursor: pointer;
    min-height: 50px;
    display: flex;
    align-items: center;
}

.tool-input[type="file"]::file-selector-button {
    margin-right: 16px;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-input[type="file"]::file-selector-button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Color Input Styling */
.tool-input[type="color"] {
    padding: 4px;
    height: 50px;
    cursor: pointer;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
}

.tool-input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.tool-input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.tool-input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 6px;
}

/* Select dropdown dark mode fix */
select.tool-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
    cursor: pointer;
}

select.tool-input option {
    background: var(--bg-card, #1a1a2e);
    color: var(--text-primary, #ffffff);
    padding: 10px;
}

[data-theme="light"] select.tool-input option {
    background: #ffffff;
    color: #1a1a2e;
}

.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.tool-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: var(--spacing-sm);
}

.result-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    margin-top: var(--spacing-sm);
}

.result-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.result-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.tool-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: var(--spacing-sm);
}

.tool-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.tool-btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.tool-btn-primary:hover {
    transform: translateY(-2px);
}

.tool-btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.tool-btn-secondary:hover {
    border-color: var(--primary);
}

.tool-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.tool-options {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: var(--spacing-sm);
}

.tool-option label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
}

/* Auto-style checkboxes inside tool-option */
.tool-option label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--bg-glass);
    border: 2px solid var(--text-muted, #666);
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    position: relative;
}

.tool-option label input[type="checkbox"]:hover {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.tool-option label input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.tool-option label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Custom Checkbox Styling */
.tool-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.tool-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.tool-checkbox .checkmark {
    position: relative;
    width: 20px;
    height: 20px;
    background: var(--bg-glass);
    border: 2px solid var(--border-color);
    border-radius: 5px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.tool-checkbox:hover .checkmark {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.tool-checkbox input[type="checkbox"]:checked+.checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.tool-checkbox .checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.tool-checkbox input[type="checkbox"]:checked+.checkmark::after {
    display: block;
}

.tool-checkbox .checkbox-label {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Native checkbox fallback styling */
input[type="checkbox"].tool-input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Toggle Switch Variant */
.tool-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.tool-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.tool-toggle .toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border-color);
    border-radius: 24px;
    transition: all 0.3s ease;
}

.tool-toggle .toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tool-toggle:hover .toggle-slider {
    background: var(--text-muted);
}

.tool-toggle input[type="checkbox"]:checked+.toggle-slider {
    background: var(--primary);
}

.tool-toggle input[type="checkbox"]:checked+.toggle-slider::before {
    transform: translateX(20px);
}

.tool-toggle .toggle-label {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.tool-description {
    padding: 32px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-glass);
}

.tool-description h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px;
}

.tool-description-content {
    color: var(--text-muted);
    line-height: 1.7;
}

/* Sidebar - Sticky */
.tool-sidebar {
    position: sticky;
    top: calc(var(--header-height) + var(--spacing-lg) + var(--breaking-height));
    align-self: start;
}

.tool-sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.tool-sidebar-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px;
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

.related-tools {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.related-tool-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-glass);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s;
}

.related-tool-item:hover {
    background: var(--primary);
    color: white;
}

.related-tool-arrow {
    opacity: 0.5;
}

.related-tool-item:hover .related-tool-arrow {
    opacity: 1;
}

.tool-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

@media (max-width: 900px) {
    .tool-layout {
        grid-template-columns: 1fr;
    }

    .tool-grid {
        grid-template-columns: 1fr;
    }
}

/* Star Rating */
.rating-card {
    text-align: center;
}

.star-rating {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 12px;
}

.star-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--border-color);
    transition: all 0.2s;
}

.star-btn svg {
    width: 28px;
    height: 28px;
}

.star-btn:hover,
.star-btn.active,
.star-btn.hovered {
    color: #fbbf24;
    transform: scale(1.1);
}

.rating-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.avg-rating {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fbbf24;
    margin-right: 4px;
}

/* FAQ Section */
.tool-faq {
    padding: 32px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-glass);
}

.tool-faq h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 20px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-card);
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: left;
    transition: background 0.2s;
}

.faq-question:hover {
    background: var(--bg-glass);
}

.faq-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.3s;
}

.faq-item.open .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 16px 20px;
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
    border-top: 1px solid var(--border-color);
}