/* Tanita Dashboard Styling */

.tanita-dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Views */
.tanita-view {
    display: none;
}

.tanita-view.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dashboard Header */
.tanita-dashboard-header {
    text-align: center;
    margin-bottom: 30px;
}

.tanita-dashboard-header h2 {
    font-size: 2.5em;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

.tanita-date {
    color: #7f8c8d;
    font-size: 1.1em;
}

/* Action Buttons */
.tanita-dashboard-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.tanita-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tanita-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.tanita-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tanita-btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.tanita-btn-sm {
    padding: 8px 16px;
    font-size: 0.9em;
}

.tanita-btn-large {
    padding: 16px 32px;
    font-size: 1.2em;
}

.tanita-btn-back {
    background: #ecf0f1;
    color: #2c3e50;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    margin-bottom: 20px;
}

.tanita-btn-back:hover {
    background: #bdc3c7;
}

/* Statistics Cards */
.tanita-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.tanita-stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.tanita-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.stat-icon {
    font-size: 3em;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    filter: grayscale(0.3);
}

.stat-info h3 {
    font-size: 2.5em;
    margin: 0;
    color: #2c3e50;
}

.stat-info p {
    margin: 5px 0 0 0;
    color: #7f8c8d;
    font-size: 1em;
}

/* Dashboard Content */
.tanita-dashboard-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

@media (max-width: 968px) {
    .tanita-dashboard-content {
        grid-template-columns: 1fr;
    }
}

.tanita-dashboard-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
}

.tanita-dashboard-section h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.5em;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

/* Recent Measurements */
.tanita-recent-list {
    max-height: 500px;
    overflow-y: auto;
}

.tanita-recent-item {
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.tanita-recent-item:hover {
    background: #f8f9fa;
}

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

.recent-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.recent-item-header strong {
    font-size: 1.1em;
    color: #2c3e50;
}

.recent-item-time {
    color: #95a5a6;
    font-size: 0.9em;
}

.recent-item-info {
    color: #7f8c8d;
    font-size: 0.95em;
}

/* Search View */
.tanita-view-header {
    margin-bottom: 30px;
}

.tanita-view-header h2 {
    font-size: 2em;
    color: #2c3e50;
    margin: 10px 0;
}

.tanita-search-container {
    max-width: 1000px;
    margin: 0 auto;
}

.tanita-search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.tanita-search-large {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 1.1em;
    transition: border-color 0.3s ease;
}

.tanita-search-large:focus {
    outline: none;
    border-color: #667eea;
}

.tanita-search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Customer Cards */
.tanita-customer-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tanita-customer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.customer-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.customer-card-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3em;
}

.customer-card-badge {
    font-size: 1.5em;
}

.customer-card-info p {
    margin: 8px 0;
    color: #7f8c8d;
}

.customer-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Form Styling */
.tanita-form {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
}

.tanita-alert {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
    color: #856404;
}

.tanita-form-section {
    margin-bottom: 35px;
}

.tanita-form-section h3 {
    color: #2c3e50;
    font-size: 1.4em;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
    padding-left: 15px;
}

.tanita-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.tanita-field {
    display: flex;
    flex-direction: column;
}

.tanita-field label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.tanita-field input,
.tanita-field select,
.tanita-field textarea {
    padding: 12px 15px;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.tanita-field input:focus,
.tanita-field select:focus,
.tanita-field textarea:focus {
    outline: none;
    border-color: #667eea;
}

.tanita-field input:read-only {
    background: #f8f9fa;
    color: #7f8c8d;
}

.tanita-help-text {
    font-size: 0.85em;
    color: #95a5a6;
    margin-top: 5px;
}

/* Body Diagram */
.tanita-body-diagram {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.physique-grid-overlay {
    text-align: center;
    margin-top: 20px;
}

.physique-score-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.5em;
    font-weight: bold;
    display: inline-block;
}

/* Form Actions */
.tanita-form-actions {
    text-align: center;
    margin-top: 40px;
}

/* Message */
.tanita-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    display: none;
    font-weight: 500;
}

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

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

/* History Section */
.tanita-history-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-top: 40px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
}

.tanita-history-section h3 {
    color: #2c3e50;
    font-size: 1.5em;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
    padding-left: 15px;
}

/* Previous Values Display */
.tanita-previous-values {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.tanita-previous-values h4 {
    margin: 0 0 15px 0;
    font-size: 1.3em;
    color: white;
}

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

.previous-values-grid div {
    background: rgba(255,255,255,0.15);
    padding: 10px;
    border-radius: 6px;
    font-size: 0.95em;
}

.previous-values-grid strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.85em;
    opacity: 0.9;
}

.tanita-history-table {
    width: 100%;
    border-collapse: collapse;
}

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

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

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

.tanita-comparison {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
}

.tanita-comparison.positive {
    background: #d4edda;
    color: #155724;
}

.tanita-comparison.negative {
    background: #f8d7da;
    color: #721c24;
}

/* Loading and Empty States */
.tanita-loading {
    text-align: center;
    color: #95a5a6;
    padding: 40px;
    font-style: italic;
}

.tanita-empty {
    text-align: center;
    color: #95a5a6;
    padding: 40px;
}

.tanita-error {
    text-align: center;
    color: #e74c3c;
    padding: 40px;
}

/* To-Do List */
.tanita-todo-container {
    max-height: 500px;
    overflow-y: auto;
}

.tanita-todo-item {
    padding: 15px;
    border-left: 4px solid #667eea;
    background: #f8f9fa;
    margin-bottom: 15px;
    border-radius: 0 8px 8px 0;
    transition: all 0.3s ease;
}

.tanita-todo-item:hover {
    background: #ecf0f1;
    transform: translateX(5px);
}

.tanita-todo-item.completed {
    opacity: 0.6;
    border-left-color: #95a5a6;
}

.todo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.todo-header strong {
    color: #2c3e50;
    font-size: 1.1em;
}

.todo-action {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.todo-date {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.todo-note {
    background: white;
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 0.9em;
    color: #2c3e50;
    border-left: 3px solid #3498db;
}

.todo-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.todo-complete-btn,
.todo-view-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.todo-complete-btn {
    background: #27ae60;
    color: white;
}

.todo-complete-btn:hover {
    background: #229954;
    transform: translateY(-2px);
}

.todo-view-btn {
    background: #3498db;
    color: white;
}

.todo-view-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .tanita-dashboard-actions {
        flex-direction: column;
    }
    
    .tanita-btn {
        width: 100%;
    }
    
    .tanita-form-grid {
        grid-template-columns: 1fr;
    }
    
    .tanita-search-box {
        flex-direction: column;
    }
    
    .tanita-search-results-grid {
        grid-template-columns: 1fr;
    }
    
    .customer-card-actions {
        flex-direction: column;
    }
    
    .customer-card-actions .tanita-btn {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .tanita-dashboard-actions,
    .tanita-btn-back,
    .customer-card-actions {
        display: none;
    }
}
