/* File Size Converter - Modern SaaS Design */

.file-size-converter-tool {
    max-width: 900px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.tool-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e5e7eb;
}

.tool-header h3 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-header p {
    font-size: 1.1rem;
    color: #6b7280;
    margin: 0;
}

.converter-container {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 10px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    margin-bottom: 30px;
}

/* Conversion Inputs */
.conversion-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: start;
    margin-bottom: 30px;
}

.input-group {
    min-width: 0;
    flex: 1 1 auto;
}

@media (min-width: 769px) {
    .conversion-inputs {
        align-items: center;
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-group label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input,
.input-group select {
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    background: #ffffff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    will-change: transform, border-color, box-shadow;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.input-group input {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    overflow-wrap: break-word;
    word-break: break-all;
    min-width: 0;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.input-group input[readonly] {
    background: #f8fafc;
    color: #667eea;
    font-weight: 700;
    font-size: 16px;
    cursor: default;
    transition: opacity 0.2s ease, color 0.2s ease;
    overflow-wrap: break-word;
    word-break: break-all;
    white-space: normal;
    min-height: 56px;
    resize: vertical;
    overflow-y: auto;
    overflow-x: hidden;
    line-height: 1.5;
    max-width: 100%;
}

.input-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    padding-right: 50px;
    cursor: pointer;
}

.input-group select:hover {
    border-color: #d1d5db;
}

/* Swap Button */
.swap-button {
    display: flex;
    justify-content: center;
    align-items: center;
}

#swap-units {
    width: 56px;
    height: 56px;
    border: 2px solid #e5e7eb;
    background: #ffffff;
    border-radius: 50%;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    will-change: transform, background, border-color;
}

#swap-units:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-color: #667eea;
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

#swap-units:active {
    transform: rotate(180deg) scale(0.95);
}

/* Conversion Options */
.conversion-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
    padding: 25px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
}

.option-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #6b7280;
}

.radio-item:hover {
    background: #ffffff;
    color: #374151;
}

.radio-item input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.radio-item input[type="radio"]:checked + span,
.radio-item:has(input[type="radio"]:checked) {
    color: #667eea;
    font-weight: 600;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    will-change: transform, box-shadow;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    flex: 1;
    min-width: 140px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary {
    background: #ffffff;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #d1d5db;
    color: #374151;
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: #ffffff;
}

/* All Conversions Grid */
.all-conversions {
    margin-bottom: 30px;
}

.all-conversions h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
}

#all-conversions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
}

.conversion-item {
    padding: 16px;
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, background, border-color;
    min-width: 120px;
    max-width: 100%;
    flex: 0 1 auto;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: break-all;
    overflow: visible;
}

.conversion-item:hover {
    background: #ffffff;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.conversion-unit {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    word-break: break-word;
}

.conversion-value {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    transition: color 0.2s ease;
    word-break: break-all;
    overflow-wrap: anywhere;
    white-space: normal;
    line-height: 1.5;
    max-width: 100%;
    display: block;
    hyphens: auto;
}

/* File Size Examples */
.file-size-examples {
    margin-bottom: 30px;
}

.file-size-examples h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
}

.examples-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
}

.example-item {
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    will-change: transform, background, border-color;
    min-width: 120px;
    max-width: 100%;
    width: auto;
    flex: 0 1 auto;
    box-sizing: border-box;
    overflow-wrap: break-word;
}

.example-item:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.example-item:hover .example-name,
.example-item:hover .example-size {
    color: #ffffff;
}

.example-name {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.example-size {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Conversion History */
.conversion-history {
    margin-bottom: 30px;
}

.conversion-history h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
}

#history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    padding: 16px;
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, background, border-color;
}

.history-item:hover {
    background: #ffffff;
    border-color: #667eea;
    transform: translateX(4px);
}

.history-content {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.history-value {
    font-weight: 700;
    color: #1f2937;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.history-arrow {
    color: #667eea;
    font-weight: 700;
}

.history-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #6b7280;
}

.history-standard {
    text-transform: uppercase;
    font-weight: 600;
    padding: 2px 8px;
    background: #e5e7eb;
    border-radius: 4px;
}

.no-history {
    text-align: center;
    color: #9ca3af;
    padding: 40px;
    font-style: italic;
}


/* Tool Info */
.tool-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.info-section {
    background: #ffffff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.info-section h4 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.info-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-section li {
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    color: #6b7280;
    line-height: 1.6;
}

.info-section li:last-child {
    border-bottom: none;
}

.info-section strong {
    color: #1f2937;
    font-weight: 600;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Smooth number transitions */
.conversion-value,
.input-group input[readonly] {
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Optimize rendering */
.converter-container,
.conversion-inputs,
#all-conversions-grid {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .converter-container {
        padding: 24px;
    }
    
    .conversion-inputs {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .swap-button {
        order: 2;
    }
    
    .conversion-options {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .examples-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .tool-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .tool-header h3 {
        font-size: 2rem;
    }
    
    #all-conversions-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .conversion-value {
        font-size: 12px;
    }
    
    .input-group input,
    .input-group input[readonly] {
        font-size: 14px;
    }
}

