* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #667eea;
}

header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 1.1em;
}

/* Stats Section */
.stats-section {
    margin-bottom: 40px;
}

.stats-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 2em;
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Form Section */
.form-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 40px;
}

.form-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.form-error {
    display: none;
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 5px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-error.visible {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:invalid:not(:placeholder-shown),
.form-group input.error {
    border-color: #dc3545;
}

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

.form-buttons {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-danger:hover {
    background: #c82333;
}

/* List Section & Paging */
.list-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.list-filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.search-input {
    flex: 2;
    min-width: 180px;
    padding: 10px;
    border-radius: 5px;
    border: 2px solid #ddd;
}

.sort-controls,
.page-size-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-controls label,
.page-size-controls label {
    font-weight: 600;
    color: #333;
}

.btn-sort-dir {
    padding: 8px 16px;
}

.paging-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.page-indicator {
    font-weight: 600;
    color: #333;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

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

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
}

.image-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.workout-image-thumb {
    width: 90px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
}

tbody tr:hover {
    background: #f8f9fa;
}

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

td button {
    margin-right: 5px;
}

.intensity-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.9em;
}

.intensity-badge.low {
    background: #d4edda;
    color: #155724;
}

.intensity-badge.medium {
    background: #fff3cd;
    color: #856404;
}

.intensity-badge.high {
    background: #f8d7da;
    color: #721c24;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.5em;
}

.modal-content p {
    margin-bottom: 25px;
    color: #666;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Mobile */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 2em;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .paging-controls {
        flex-direction: column;
    }

    table {
        font-size: 0.9em;
    }

    th, td {
        padding: 10px;
    }

    td button {
        display: block;
        margin-bottom: 5px;
    }
}
