/* Base64 Encoder/Decoder Tool Styles */

/* Tool Container - Full Page Layout */
.base64-converter-tool {
    width: 100%;
    min-height: 100vh;
    background: #ffffff;
    padding: 0;
    margin: 0;
}

.tool-container {
    max-width: 1000px;
    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: var(--text-color);
    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: 2rem;
}

.converter-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
}



/* Section Label */
.section-label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}

/* Encoding Options */
.encoding-options {
    margin-bottom: 1.5rem;
    text-align: center;
}

.options-grid {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Mobile-first: Display side by side on mobile as requested */
@media (max-width: 768px) {
    .options-grid {
        gap: 1rem;
        justify-content: space-around;
    }
}

.option-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.option-item:hover {
    background: #f8fafc;
}

.option-item input[type="radio"] {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.option-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tooltip {
    position: relative;
    cursor: help;
    color: var(--primary-color);
}

.tooltip:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 250px;
    white-space: normal;
}

.tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
    z-index: 1000;
}

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

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

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

.input-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.input-group {
    position: relative;
    display: flex;
    flex-direction: column;
}

.input-textarea {
    width: 100%;
    padding: 1.5rem;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background-color: #f9fafb;
    transition: all 0.2s ease-in-out;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    resize: vertical;
    min-height: 150px;
}

.input-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-textarea::placeholder {
    color: #9ca3af;
}

.input-controls {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.control-btn:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.input-info {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-color);
}

/* Action Controls */
.action-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-width: 160px;
    justify-content: center;
    min-height: 44px;
}

.encode-btn {
    background: #10b981;
    color: white;
}

.encode-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.decode-btn {
    background: #3b82f6;
    color: white;
}

.decode-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}



/* Loading State */
.loading-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Messages */
.message-container {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.message-container.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.message-container.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.message-icon {
    font-size: 1.25rem;
}

/* Result Section */
.result-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.result-section.show {
    opacity: 1;
    transform: translateY(0);
}

.result-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid #e5e7eb;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981, #3b82f6, #8b5cf6, #f59e0b);
    background-size: 300% 100%;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
    flex-wrap: wrap;
    gap: 1rem;
}

.result-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.result-actions {
    display: flex;
    gap: 0.75rem;
}

.result-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    min-height: 44px;
}

.result-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    
}

/* Result Content */
.result-content {
    margin-bottom: 2rem;
}

.result-output {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

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

.output-container {
    position: relative;
}

.output-textarea {
    width: 100%;
    min-height: 150px;
    padding: 1.5rem;
    font-size: 0.875rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-family: 'Courier New', monospace;
    line-height: 1.5;
    resize: vertical;
    color: var(--text-color);
}

.output-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.output-stats {
    margin-top: 1rem;
    display: flex;
    gap: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.output-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* Conversion Details */
.conversion-details {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.conversion-details h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}

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

.detail-item {
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

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

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

/* Popular Examples */
.popular-examples {
    margin-bottom: 2rem;
}

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

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

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

.example-item {
    padding: 1.5rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.example-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.example-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #10b981, #3b82f6, #8b5cf6);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.example-item:hover::before {
    transform: scaleX(1);
}

.example-icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    transition: transform 0.2s ease;
}

.example-item:hover .example-icon {
    transform: scale(1.1);
}

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

.example-input {
    font-size: 0.75rem;
    color: var(--text-light);
    font-family: 'Courier New', monospace;
    margin-bottom: 0.5rem;
    word-break: break-all;
    line-height: 1.4;
}

.example-output {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    font-weight: 500;
    word-break: break-all;
    line-height: 1.4;
}

/* SEO Content */
.seo-content {
    background: #f8fafc;
    padding: 3rem 0;
    margin-top: 3rem;
}

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

.content-section {
    margin-bottom: 2.5rem;
}

.content-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
}

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

.content-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

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

.content-section ul,
.content-section ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.content-section li {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

/* Medium screens - keep buttons side by side */
@media (max-width: 900px) {
    .mode-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        max-width: 500px;
    }

    .mode-btn {
        width: 100%;
        padding: 1rem;
        min-height: 70px;
    }
}

/* 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.75rem 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;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

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

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

    .mode-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        max-width: 100%;
    }

    .mode-btn {
        padding: 1rem;
        min-height: 65px;
        width: 100%;
        font-size: 0.9rem;
    }

    .options-grid {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .input-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .input-stats {
        flex-wrap: wrap;
    }

    .input-controls {
        position: static;
        margin-top: 0.75rem;
        justify-content: flex-end;
    }

    .input-textarea {
        padding: 1rem;
        min-height: 120px;
    }

    .action-controls {
        flex-direction: column;
        align-items: center;
    }

    .action-btn {
        width: 100%;
        max-width: 300px;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .result-actions {
        width: 100%;
        justify-content: center;
    }

    .result-btn {
        flex: 1;
        justify-content: center;
    }

    .output-textarea {
        font-size: 0.8rem;
        min-height: 120px;
    }

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

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

    .example-item {
        padding: 1rem;
    }

    .output-stats {
        flex-direction: column;
        gap: 0.5rem;
    }

    .content-container {
        padding: 0 1rem;
    }

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

    .related-tool-link {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .tool-header h1 {
        font-size: 1.25rem;
    }

    .converter-card {
        padding: 1rem;
    }

    .result-card {
        padding: 1rem;
    }

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

    .mode-btn {
        padding: 0.75rem;
        min-height: 60px;
        width: 100%;
        font-size: 0.85rem;
    }

    .mode-content span {
        font-size: 0.9rem;
    }

    .mode-content small {
        font-size: 0.7rem;
    }

    .mode-icon {
        font-size: 1.25rem;
        margin-right: 0.5rem;
    }

    .input-textarea,
    .output-textarea {
        padding: 0.75rem;
        font-size: 0.875rem;
    }

    .control-btn {
        width: 32px;
        height: 32px;
    }

    .tooltip:hover::after {
        max-width: 200px;
        font-size: 0.7rem;
    }

    .example-input,
    .example-output {
        font-size: 0.7rem;
    }

    .result-actions {
        flex-direction: column;
    }

    .result-btn {
        width: 100%;
    }

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

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