/* Text Size Calculator - Text Encoding and Size Analysis Tool */

.tool-form.text-size-calculator {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

/* Input Section */
.input-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.text-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.text-input-container label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.text-input-container label::before {
    content: "📝";
    font-size: 1.2rem;
}

#text-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 1rem;
    resize: vertical;
    min-height: 200px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

#text-input:focus {
    border-color: #4a90e2;
    outline: none;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.15), inset 0 1px 3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.input-controls {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.clear-btn, .sample-btn {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.clear-btn:hover, .sample-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.clear-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.clear-btn:hover {
    background: linear-gradient(135deg, #ff5252 0%, #d63031 100%);
}

.sample-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.sample-btn:hover {
    background: linear-gradient(135deg, #00b4d8 0%, #0077b6 100%);
}

.encoding-selector {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.encoding-selector label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.encoding-selector label::before {
    content: "🔤";
    font-size: 1.2rem;
}

#encoding-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

#encoding-select:focus {
    border-color: #4a90e2;
    outline: none;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.15), inset 0 1px 3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

#encoding-select:hover {
    border-color: #a0c4ff;
}

/* Results Section */
.results-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.results-section h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-section h3::before {
    content: "📊";
    font-size: 1.4rem;
}

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

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border-left: 5px solid #4a90e2;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.result-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
}

.result-value {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.1rem;
    background: rgba(74, 144, 226, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

/* Encoding Details */
.encoding-details {
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e6ed;
}

.encoding-details h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.encoding-details h4::before {
    content: "🔍";
    font-size: 1.3rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 10px;
    border-left: 3px solid #6c757d;
    transition: transform 0.2s ease;
}

.detail-item:hover {
    transform: translateX(5px);
}

.detail-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.95rem;
}

.detail-value {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: #2c3e50;
    font-weight: 600;
    background: rgba(108, 117, 125, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

/* Byte Representation */
.byte-representation {
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e6ed;
}

.byte-representation h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.byte-representation h4::before {
    content: "💾";
    font-size: 1.3rem;
}

.byte-display {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-radius: 12px;
    padding: 1.5rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    max-height: 200px;
    overflow: auto;
    color: #e2e8f0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.byte-hex, .byte-binary {
    margin-bottom: 0.75rem;
    word-break: break-all;
    line-height: 1.5;
}

.byte-hex {
    color: #63b3ed;
}

.byte-binary {
    color: #68d391;
}

/* Info Section */
.info-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-card {
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.info-card h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-card h4::before {
    content: "ℹ️";
    font-size: 1.3rem;
}

.info-card p {
    margin: 0;
    color: #495057;
    line-height: 1.6;
}

.info-content {
    color: #495057;
    line-height: 1.6;
}

.info-content p {
    margin-bottom: 1rem;
}

.info-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.info-content li {
    margin-bottom: 0.5rem;
    position: relative;
}

.info-content li::before {
    content: "•";
    color: #4a90e2;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-form.text-size-calculator {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .input-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .input-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .clear-btn, .sample-btn {
        padding: 0.75rem 1rem;
        justify-content: center;
    }
    
    .results-section, .info-card {
        padding: 1rem;
    }
    
    .result-item {
        padding: 0.75rem;
    }
    
    .detail-item {
        padding: 0.5rem 0.75rem;
    }
    
    .byte-display {
        padding: 1rem;
        font-size: 0.85rem;
    }
    
    .info-card h4, .encoding-details h4, .byte-representation h4 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .tool-form.text-size-calculator {
        padding: 0.75rem;
        margin: 0.25rem;
    }
    
    .results-section, .info-card {
        padding: 0.75rem;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        padding: 0.5rem;
    }
    
    #text-input {
        min-height: 150px;
        font-size: 0.9rem;
    }
}