/* Chinese Number Converter Styles */

/* Result Display Section */
.result-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Result Row - contains 2 items side by side */
.result-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.result-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    position: relative;
}

/* Full width result item */
.result-item.result-full {
    width: 100%;
}

.result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* Result Header - label and copy button on same line */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.result-item label {
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
    margin: 0;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    word-break: break-all;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
}

.result-value.empty {
    color: #adb5bd;
    font-weight: 400;
    font-size: 1.1rem;
}

/* Copy Button */
.btn-copy {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.btn-copy:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.btn-copy:active {
    transform: translateY(0);
}

.btn-copy i {
    font-size: 0.85rem;
}

/* Quick Example Buttons */
.example-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn-example {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #4c51bf;
    border: 2px solid #a5b4fc;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-example:hover {
    background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.2);
}

.btn-example:active {
    transform: translateY(0);
}

/* Clear Button */
.btn-clear {
    background: linear-gradient(135deg, #fed7d7 0%, #fbb6ce 100%);
    color: #c53030;
    border: 2px solid #fc8181;
}

.btn-clear:hover {
    background: linear-gradient(135deg, #fbb6ce 0%, #f687b3 100%);
}

/* Structure Breakdown Section */
.structure-content {
    background: linear-gradient(135deg, #e0f2ff 0%, #bfdbfe 100%);
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid #3b82f6;
}

.structure-content p {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: #1e40af;
    line-height: 1.6;
}

.structure-content p:last-child {
    margin-bottom: 0;
    font-weight: 600;
}

.structure-content strong {
    color: #1e3a8a;
    font-size: 1.1rem;
}

/* Comparison Table */
.comparison-table {
    width: 100%;
    margin-top: 1rem;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.comparison-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.comparison-table th {
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
}

.comparison-table td {
    padding: 0.875rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.95rem;
}

.comparison-table tbody tr:hover {
    background-color: #f7fafc;
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

/* Input Section Enhancements */
.form-input {
    font-size: 1.1rem;
    padding: 0.875rem;
}

.form-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Info Card */
.info-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.info-card p {
    margin-bottom: 0.5rem;
    color: #92400e;
    font-size: 0.95rem;
    line-height: 1.6;
}

.info-card p:last-child {
    margin-bottom: 0;
}

/* Error Message */
.error-message {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    border-left: 4px solid #f56565;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    color: #c53030;
    font-weight: 500;
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Success Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item.show {
    animation: fadeInUp 0.5s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Make result-row single column on tablets */
    .result-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .result-value {
        font-size: 1.25rem;
        padding: 0.875rem;
    }

    .result-item {
        padding: 1.25rem;
    }

    .result-header {
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    .result-item label {
        font-size: 0.9rem;
        flex-shrink: 1;
    }

    .btn-copy {
        padding: 0.35rem 0.75rem;
        font-size: 0.8rem;
        flex-shrink: 0;
    }

    .btn-copy i {
        font-size: 0.8rem;
    }

    .example-buttons {
        gap: 0.5rem;
    }

    .btn-example {
        padding: 0.5rem 0.875rem;
        font-size: 0.85rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .structure-content {
        padding: 1.25rem;
    }

    .structure-content p {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .result-value {
        font-size: 1.1rem;
    }

    .btn-copy {
        width: 100%;
        justify-content: center;
    }

    .example-buttons {
        flex-direction: column;
    }

    .btn-example {
        width: 100%;
    }

    .action-buttons-grid {
        grid-template-columns: 1fr;
    }
}

/* Action Buttons Grid */
.action-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* Action Buttons */
.btn-custom,
.btn-custom-outline {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
}

.btn-custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-custom-outline {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-custom-outline:hover {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.btn-custom:active,
.btn-custom-outline:active {
    transform: translateY(0);
}

/* Sponsor Button */
.btn-sponsor {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
}

.btn-sponsor:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-sponsor:active {
    transform: translateY(0);
}

/* Print Styles */
@media print {
    .btn-copy,
    .btn-example,
    .btn-clear,
    .btn-custom,
    .btn-custom-outline,
    .example-buttons {
        display: none;
    }

    .result-item {
        break-inside: avoid;
    }
}
