/* CSS Custom Properties */
:root {
    --primary: 220 85% 57%; /* #3B82F6 */
    --primary-dark: 220 85% 47%; /* #2563EB */
    --secondary: 142 76% 36%; /* #16A34A */
    --danger: 0 84% 60%; /* #EF4444 */
    --warning: 45 93% 47%; /* #F59E0B */
    --background: 210 11% 98%; /* #F5F7FA */
    --surface: 0 0% 100%; /* #FFFFFF */
    --surface-dark: 210 11% 96%; /* #F1F5F9 */
    --text: 215 25% 27%; /* #374151 */
    --text-light: 215 14% 54%; /* #6B7280 */
    --text-muted: 215 12% 74%; /* #9CA3AF */
    --border: 214 13% 93%; /* #E5E7EB */
    --border-focus: 220 85% 57%; /* #3B82F6 */
    --shadow: 0 0% 0%; /* #000000 */
    --border-radius: 8px;
    --transition: all 0.2s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: hsl(var(--text));
    background-color: hsl(var(--background));
    font-size: 16px;
}

/* Container and Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: hsl(var(--primary));
    margin-bottom: 8px;
}

header h1 i {
    margin-right: 12px;
}

header p {
    color: hsl(var(--text-light));
    font-size: 1.1rem;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Profile Section */
.profile-section {
    background: hsl(var(--surface));
    border-radius: var(--border-radius);
    padding: 32px;
    box-shadow: 0 1px 3px hsla(var(--shadow) / 0.1);
    border: 1px solid hsl(var(--border));
}

.profile-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: hsl(var(--text));
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.profile-btn {
    padding: 12px 20px;
    background: hsl(var(--secondary));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    align-self: flex-start;
}

.profile-btn:hover {
    background: hsl(142 76% 30%);
}

.profile-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: hsl(var(--surface-dark));
    border-radius: var(--border-radius);
    border: 1px solid hsl(var(--border));
}

.profile-display.hidden {
    display: none;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: hsl(var(--text));
}

.profile-details {
    font-size: 0.9rem;
    color: hsl(var(--text-light));
}

.edit-btn {
    padding: 8px 16px;
    background: hsl(var(--primary));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.edit-btn:hover {
    background: hsl(var(--primary-dark));
}

/* Form Section */
.form-section {
    background: hsl(var(--surface));
    border-radius: var(--border-radius);
    padding: 32px;
    box-shadow: 0 1px 3px hsla(var(--shadow) / 0.1);
    border: 1px solid hsl(var(--border));
}

.form-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: hsl(var(--text));
}

/* Form Styles */
.tracking-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 6px;
    color: hsl(var(--text));
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    padding: 12px 16px;
    border: 1px solid hsl(var(--border));
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: hsl(var(--surface));
    color: hsl(var(--text));
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: hsl(var(--border-focus));
    box-shadow: 0 0 0 3px hsla(var(--primary) / 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: hsl(var(--text-muted));
}

/* Rating Slider Styles */
.rating-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.rating-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: hsl(var(--border));
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.rating-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: hsl(var(--primary));
    cursor: pointer;
    border: 2px solid hsl(var(--surface));
    box-shadow: 0 2px 4px hsla(var(--shadow) / 0.2);
}

.rating-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: hsl(var(--primary));
    cursor: pointer;
    border: 2px solid hsl(var(--surface));
    box-shadow: 0 2px 4px hsla(var(--shadow) / 0.2);
}

.rating-display {
    display: flex;
    align-items: baseline;
    gap: 2px;
    min-width: 50px;
}

.rating-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: hsl(var(--primary));
}

.rating-scale {
    font-size: 0.9rem;
    color: hsl(var(--text-light));
}

.rating-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: hsl(var(--text-light));
}

/* Button Styles */
.submit-btn {
    padding: 14px 24px;
    background: hsl(var(--primary));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.submit-btn:hover {
    background: hsl(var(--primary-dark));
}

.submit-btn:active {
    transform: translateY(1px);
}

/* Success Message */
.success-message {
    background: hsl(var(--secondary));
    color: white;
    padding: 16px 24px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    animation: slideInUp 0.3s ease;
}

.success-message.hidden {
    display: none;
}

/* Data Section */
.data-section {
    background: hsl(var(--surface));
    border-radius: var(--border-radius);
    padding: 32px;
    box-shadow: 0 1px 3px hsla(var(--shadow) / 0.1);
    border: 1px solid hsl(var(--border));
}

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

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: hsl(var(--text));
}

.data-controls {
    display: flex;
    gap: 12px;
}

.control-btn {
    padding: 10px 16px;
    border: 1px solid hsl(var(--border));
    border-radius: var(--border-radius);
    background: hsl(var(--surface));
    color: hsl(var(--text));
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-btn:hover {
    background: hsl(var(--surface-dark));
}

.control-btn.danger {
    color: hsl(var(--danger));
    border-color: hsla(var(--danger) / 0.3);
}

.control-btn.danger:hover {
    background: hsla(var(--danger) / 0.1);
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
    border: 1px solid hsl(var(--border));
}

.entries-table {
    width: 100%;
    border-collapse: collapse;
    background: hsl(var(--surface));
}

.entries-table th {
    background: hsl(var(--surface-dark));
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: hsl(var(--text));
    border-bottom: 1px solid hsl(var(--border));
    font-size: 0.9rem;
    white-space: nowrap;
}

.entries-table td {
    padding: 16px 12px;
    border-bottom: 1px solid hsl(var(--border));
    color: hsl(var(--text));
    font-size: 0.9rem;
}

.entries-table tbody tr:hover {
    background: hsl(var(--surface-dark));
}

.entries-table tbody tr:last-child td {
    border-bottom: none;
}

/* Rating Badge */
.rating-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.8rem;
    color: white;
}

.rating-badge.excellent { background: hsl(var(--secondary)); }
.rating-badge.good { background: hsl(var(--warning)); }
.rating-badge.poor { background: hsl(var(--danger)); }

/* Action Button */
.action-btn {
    padding: 6px 8px;
    border: none;
    border-radius: 4px;
    background: hsla(var(--danger) / 0.1);
    color: hsl(var(--danger));
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.8rem;
}

.action-btn:hover {
    background: hsla(var(--danger) / 0.2);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: hsl(var(--text-light));
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: hsl(var(--text));
}

.empty-state.hidden {
    display: none;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: hsla(var(--shadow) / 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: hsl(var(--surface));
    border-radius: var(--border-radius);
    padding: 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 25px hsla(var(--shadow) / 0.2);
}

.modal-content h3 {
    margin-bottom: 16px;
    color: hsl(var(--text));
}

.modal-content p {
    margin-bottom: 24px;
    color: hsl(var(--text-light));
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-secondary,
.btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary {
    background: hsl(var(--surface-dark));
    color: hsl(var(--text));
}

.btn-secondary:hover {
    background: hsl(var(--border));
}

.btn-danger {
    background: hsl(var(--danger));
    color: white;
}

.btn-danger:hover {
    background: hsl(0 84% 50%);
}

/* Footer */
footer {
    margin-top: 40px;
    text-align: center;
    padding: 20px 0;
    color: hsl(var(--text-light));
    font-size: 0.9rem;
    border-top: 1px solid hsl(var(--border));
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .form-section,
    .data-section {
        padding: 24px 20px;
    }
    
    .form-row,
    .profile-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .data-controls {
        justify-content: center;
    }
    
    .entries-table {
        font-size: 0.8rem;
    }
    
    .entries-table th,
    .entries-table td {
        padding: 12px 8px;
    }
    
    .modal-content {
        padding: 24px 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    
    .form-section,
    .data-section {
        padding: 20px 16px;
    }
    
    .rating-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .rating-display {
        justify-content: center;
    }
    
    .data-controls {
        flex-direction: column;
    }
    
    .control-btn {
        justify-content: center;
    }
}

/* Print Styles */
@media print {
    .form-section,
    .data-controls,
    footer {
        display: none;
    }
    
    .data-section {
        box-shadow: none;
        border: none;
        padding: 0;
    }
    
    .entries-table th {
        background: none;
        border: 1px solid #000;
    }
    
    .entries-table td {
        border: 1px solid #000;
    }
}
