/* Weight Converter Tool Styles */

/* Tool Container - Full Page Layout */
.weight-converter-tool {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 0;
    margin: 0;
}

.tool-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

.tool-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: rgb(34, 33, 33);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.tool-header h1 i {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.tool-description {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 0;
    line-height: 1.6;
}

/* Converter Interface */
.converter-interface {
    margin-bottom: 3rem;
}

.converter-card {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

/* Input Section */
.input-section {
    margin-bottom: 2rem;
}

.input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.weight-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.weight-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    font-size: 1.125rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background-color: #f9fafb;
    transition: all 0.2s ease-in-out;
    text-align: center;
    font-weight: 500;
}

.weight-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(50, 146, 109, 0.1);
}

.clear-btn {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
}

.clear-btn:hover {
    color: #ef4444;
    background-color: #fef2f2;
}

/* Unit Controls */
.unit-controls {
    margin-bottom: 2rem;
}

.unit-selectors {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.5rem;
}

.unit-group {
    display: flex;
    flex-direction: column;
}

.unit-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.unit-select {
    padding: 0.875rem;
    font-size: 0.9rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background-color: #f9fafb;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    font-weight: 500;
}

.unit-select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(50, 146, 109, 0.1);
}

.swap-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.swap-btn:hover {
    transform: rotate(180deg) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.convert-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.convert-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.15);
}

.convert-btn:active {
    transform: translateY(0);
}

.convert-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.convert-btn:active:not(:disabled) {
    transform: translateY(1px) scale(0.98);
}

/* Result Section */
.result-section {
    background: linear-gradient(135deg, #dcfce7 0%, #c9f4fc 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    border: 1px solid #86efac;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
}

.result-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.result-value-container {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    justify-content: center;
    flex-wrap: nowrap;
    margin-bottom: 1.5rem;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease-in-out;
    line-height: 1;
    display: inline-block;
}

.result-value.loading {
    color: var(--text-light);
    animation: pulse 1.5s ease-in-out infinite;
}

.result-unit {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    font-family: 'Courier New', monospace;
    margin-left: 0;
    line-height: 1;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.result-detail-item {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.detail-value {
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: 600;
    text-align: center;
}

/* Conversion Details */
.conversion-details {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
    transition: opacity 0.4s ease-in-out;
}

.details-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.details-title i {
    color: var(--primary-color);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.detail-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease-in-out;
}

.detail-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.875rem;
}

.detail-header i {
    color: var(--primary-color);
    font-size: 0.875rem;
}

.detail-content {
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.875rem;
    background: #f8fafc;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 2.5rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    border: 1px solid #bae6fd;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 4px solid #e0f2fe;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-indicator p {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.025em;
}

/* Error Message */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem;
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.error-message i {
    color: #dc2626;
}

/* Popular Conversions */
.popular-conversions {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.popular-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.popular-title i {
    color: #f59e0b;
}

.popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.popular-item {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

.popular-item:hover {
    background: #f0f9ff;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.popular-pair {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.popular-result {
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Related Tools Section */
.related-tools-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.related-tools-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.related-tools-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.related-tools-header h3 i {
    color: var(--primary-color);
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.related-tool-link {
    background: #f8fafc;
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    border: 1px solid #e5e7eb;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.related-tool-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.related-tool-link i {
    font-size: 0.875rem;
}

/* SEO Content Styles */
.seo-content {
    max-width: 900px;
    margin: 3rem auto 0;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.seo-content h2 {
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.seo-content h2:first-child {
    margin-top: 0;
}

.seo-content h3 {
    color: var(--text-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.seo-content p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.seo-content ul, .seo-content ol {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.seo-content li {
    margin-bottom: 0.5rem;
}

.seo-content strong {
    color: var(--text-color);
    font-weight: 600;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .tool-container {
        padding: 1rem;
    }

    .tool-header h1 {
        font-size: 1.75rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .converter-card {
        padding: 1.5rem;
    }

    .unit-selectors {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .swap-btn {
        order: 3;
        justify-self: center;
        margin-top: 1rem;
        transform: rotate(90deg);
    }

    .swap-btn:hover {
        transform: rotate(270deg) scale(1.05);
    }

    .unit-select {
        font-size: 0.875rem;
        padding: 0.75rem;
    }

    .result-value {
        font-size: 2rem;
    }

    .result-unit {
        font-size: 1.25rem;
    }

    .result-value-container {
        flex-direction: row;
        gap: 0.125rem;
        flex-wrap: nowrap;
    }

    .result-details {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .popular-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .popular-item {
        padding: 0.75rem;
    }

    .popular-pair {
        font-size: 0.8rem;
    }

    .popular-result {
        font-size: 0.85rem;
    }

    .related-tools-section {
        padding: 1.5rem;
        margin-top: 1.5rem;
    }

    .related-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .related-tool-link {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
        flex-direction: column;
        gap: 0.25rem;
    }

    .seo-content {
        margin-top: 2rem;
        padding: 1.5rem;
    }

    .seo-content h2 {
        font-size: 1.25rem;
    }

    .seo-content h3 {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .tool-container {
        padding: 0.75rem;
    }

    .tool-header h1 {
        font-size: 1.5rem;
    }

    .converter-card {
        padding: 1rem;
    }

    .weight-input {
        font-size: 1rem;
        padding: 0.875rem 2.5rem 0.875rem 0.875rem;
    }

    .unit-select {
        font-size: 0.8rem;
        padding: 0.625rem;
    }

    .convert-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }

    .result-value {
        font-size: 1.75rem;
    }

    .result-unit {
        font-size: 1.125rem;
    }

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

    .related-tools-section {
        padding: 1rem;
        margin-top: 1rem;
    }

    .related-tools-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .related-tool-link {
        padding: 0.75rem;
        font-size: 0.875rem;
        flex-direction: row;
        gap: 0.5rem;
    }

    .seo-content {
        padding: 1rem;
    }
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .spinner {
        border-width: 3px;
    }
}

/* Print Styles */
@media print {
    .weight-converter-tool {
        background: white;
    }

    .converter-card, .popular-conversions, .seo-content {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .convert-btn, .swap-btn, .clear-btn {
        display: none;
    }

    .loading-indicator, .error-message {
        display: none;
    }
}
