/* Tanita Weegkaart Styles */

.tanita-weegkaart-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tanita-header {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px 10px 0 0;
    margin: -20px -20px 20px -20px;
}

.tanita-header h2 {
    margin: 0;
    font-size: 2em;
    color: white;
}

.tanita-date {
    margin: 10px 0 0 0;
    font-size: 1.1em;
}

.tanita-alert {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.tanita-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.tanita-section h3 {
    margin-top: 0;
    color: #667eea;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.tanita-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.tanita-field {
    flex: 1;
    min-width: 200px;
    margin-bottom: 15px;
}

.tanita-field-small {
    flex: 0 0 150px;
}

.tanita-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.tanita-field input[type="text"],
.tanita-field input[type="email"],
.tanita-field input[type="number"],
.tanita-field input[type="date"],
.tanita-field select,
.tanita-field textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
    background-color: white;
    cursor: pointer;
}

.tanita-field select {
    appearance: auto;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
}

.tanita-field input:focus,
.tanita-field select:focus,
.tanita-field textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.tanita-field input:read-only {
    background: #e9ecef;
    cursor: not-allowed;
}

.tanita-note {
    display: block;
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
}

.tanita-search-wrapper {
    display: flex;
    gap: 10px;
}

.tanita-search-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.tanita-search-btn:hover {
    background: #5568d3;
}

.tanita-search-results {
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    display: none;
}

.tanita-search-results.active {
    display: block;
}

.tanita-search-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.tanita-search-item:last-child {
    border-bottom: none;
}

.tanita-search-item:hover {
    background: #f0f0f0;
}

.tanita-search-item strong {
    display: block;
    color: #333;
}

.tanita-search-item small {
    color: #666;
}

.tanita-col-left {
    flex: 1;
    min-width: 400px;
}

.tanita-col-right {
    flex: 0 0 400px;
}

.tanita-info-box {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tanita-info-box h4 {
    margin-top: 0;
    color: #667eea;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.tanita-ref-table {
    width: 100%;
    font-size: 0.9em;
    border-collapse: collapse;
}

.tanita-ref-table th {
    text-align: left;
    padding: 8px;
    background: #667eea;
    color: white;
    font-weight: bold;
}

.tanita-ref-table td {
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.tanita-ref-table tr:last-child td {
    border-bottom: none;
}

.tanita-info-text {
    font-size: 0.9em;
    line-height: 1.5;
    color: #555;
}

.tanita-physique-visual {
    margin-top: 15px;
    position: relative;
    padding-left: 50px;
}

.physique-labels {
    display: flex;
    align-items: flex-start;
    margin-bottom: 5px;
}

.label-vertical {
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
    color: #667eea;
    font-size: 13px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.physique-label-bottom {
    position: relative;
    margin-top: -10px;
}

.physique-label-bottom .label-vertical {
    position: absolute;
    left: 0;
    top: 0;
}

.label-top {
    display: flex;
    align-items: center;
    font-weight: bold;
    color: #667eea;
    font-size: 13px;
    margin-bottom: 5px;
    margin-left: -5px;
}

.physique-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.physique-cell {
    flex: 1;
    padding: 8px 5px;
    text-align: center;
    border: 2px solid #999;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.physique-cell:hover {
    border-color: #667eea;
    transform: scale(1.02);
}

.physique-cell.active {
    border-color: #667eea;
    border-width: 3px;
    background: #f0f4ff;
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.4);
    transform: scale(1.03);
}

.body-figure {
    width: 60px;
    height: 150px;
    margin: 0 auto 5px;
    display: block;
}

.score-number {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin: 3px 0;
    background: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    line-height: 30px;
    margin: 3px auto;
    border: 2px solid #333;
}

.physique-cell.active .score-number {
    color: #fff;
    background: #333;
    border-color: #333;
}

.score-label {
    font-size: 10px;
    color: #333;
    line-height: 1.2;
    min-height: 22px;
    font-weight: normal;
}

.physique-bottom-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    font-weight: bold;
    color: #667eea;
    padding: 0 3px;
    text-align: center;
}

.physique-bottom-labels span {
    flex: 1;
}

.physique-axis-label {
    text-align: center;
    font-weight: bold;
    color: #667eea;
    font-size: 13px;
    margin-top: 5px;
}

.tanita-grid-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}

.tanita-grid-label {
    width: 60px;
    font-size: 0.85em;
    font-weight: bold;
    color: #333;
}

.tanita-grid-cell {
    flex: 1;
    padding: 15px 5px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 18px;
}

.tanita-grid-cell span {
    display: block;
    font-size: 10px;
    font-weight: normal;
    margin-top: 5px;
}

.tanita-grid-cell:hover {
    background: #f0f0f0;
}

.tanita-grid-cell.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: scale(1.05);
}

.tanita-grid-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.85em;
    font-weight: bold;
    color: #667eea;
}

.tanita-submit-section {
    text-align: center;
    padding: 20px;
}

.tanita-submit-btn {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tanita-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

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

.tanita-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.tanita-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    display: none;
}

.tanita-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    display: block;
}

.tanita-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    display: block;
}

/* History Section */
.tanita-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.tanita-history-table th {
    background: #667eea;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: bold;
}

.tanita-history-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.tanita-history-table tr:hover {
    background: #f8f9fa;
}

.tanita-comparison {
    font-size: 0.9em;
    margin-left: 5px;
}

.tanita-comparison.positive {
    color: #28a745;
}

.tanita-comparison.negative {
    color: #dc3545;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .tanita-col-right {
        flex: 1 1 100%;
    }
}

@media (max-width: 768px) {
    .tanita-row {
        flex-direction: column;
    }
    
    .tanita-field,
    .tanita-field-small {
        width: 100%;
        min-width: 100%;
    }
    
    .tanita-col-left,
    .tanita-col-right {
        flex: 1 1 100%;
        min-width: 100%;
    }
    
    .tanita-grid-cell {
        font-size: 14px;
        padding: 10px 3px;
    }
    
    .tanita-header h2 {
        font-size: 1.5em;
    }
}

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

.btn-loader {
    animation: spin 1s linear infinite;
}
