/* Component Specific Styles */

/* Tool Card Component */
.tool-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.tool-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
}

.tool-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.tool-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.tool-card-description {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Tool Page Layout */
.tool-container {
    max-width: 800px;
    margin: 0 auto;
}

.tool-header {
    margin-bottom: 2rem;
}

.tool-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.tool-description {
    font-size: 1rem;
    color: #6b7280;
}

.tool-body {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.breadcrumb-item {
    color: #6b7280;
}

.breadcrumb-item.active {
    color: #1f2937;
    font-weight: 500;
}

.breadcrumb-separator {
    color: #d1d5db;
}

/* Tab Component */
.tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.tab {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tab:hover {
    color: #3b82f6;
}

.tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* Grid Layout for Tools */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* Input Group */
.input-group {
    margin-bottom: 1.25rem;
}

.input-group-row {
    display: flex;
    gap: 1rem;
}

.input-group-row > * {
    flex: 1;
}

/* Date Input Specific */
input[type="date"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
}

input[type="date"]:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Result Grid */
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.result-item {
    background: #f9fafb;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
}

.result-item-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

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

/* JSON Editor */
.json-editor {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    tab-size: 2;
}

.json-valid {
    border-color: #10b981 !important;
}

.json-invalid {
    border-color: #ef4444 !important;
}

/* Copy Button */
.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: #e5e7eb;
}

.btn-copy.copied {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

/* Switch/Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: 0.3s;
    border-radius: 26px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.switch input:checked + .switch-slider {
    background-color: #3b82f6;
}

.switch input:checked + .switch-slider:before {
    transform: translateX(22px);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

.badge-green {
    background: #dcfce7;
    color: #166534;
}

.badge-purple {
    background: #f3e8ff;
    color: #6b21a8;
}

.badge-orange {
    background: #ffedd5;
    color: #9a3412;
}

.badge-pink {
    background: #fce7f3;
    color: #9d174d;
}

/* Stats Display */
.stats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.75rem;
}

.stat-item {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 0.75rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Divider */
.divider {
    height: 1px;
    background: #e5e7eb;
    margin: 1.5rem 0;
}

/* Comparison Layout */
.comparison-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
}

.comparison-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f3f4f6;
    border-radius: 50%;
}

@media (max-width: 640px) {
    .comparison-container {
        grid-template-columns: 1fr;
    }

    .comparison-arrow {
        transform: rotate(90deg);
        margin: 0 auto;
    }

    .input-group-row {
        flex-direction: column;
    }
}

/* Live Preview Box */
.preview-box {
    background: #1f2937;
    color: #f9fafb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    font-family: monospace;
    overflow-x: auto;
}

/* Accordion */
.accordion {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid #e5e7eb;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: #f9fafb;
    cursor: pointer;
    transition: background 0.2s ease;
}

.accordion-header:hover {
    background: #f3f4f6;
}

.accordion-content {
    padding: 1rem 1.25rem;
    display: none;
}

.accordion-item.active .accordion-content {
    display: block;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-icon {
    transition: transform 0.2s ease;
}

/* Search Results Dropdown */
#searchResults .search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f3f4f6;
}

#searchResults .search-result-item:last-child {
    border-bottom: none;
}

#searchResults .search-result-item:hover {
    background: #f9fafb;
}

#searchResults .search-result-item .tool-name {
    font-weight: 500;
    color: #1f2937;
}

#searchResults .search-result-item .tool-category {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    z-index: 40;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

/* Responsive utilities */
@media (max-width: 768px) {
    .tool-body {
        padding: 1.25rem;
    }

    .tool-title {
        font-size: 1.5rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .result-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
