/* Exercise Grid Layout */
.exercise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.exercise-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.exercise-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.exercise-icon {
    background: #3498db;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
}

.exercise-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: #2c3e50;
    line-height: 1.2;
    /* Handle long exercise names */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.exercise-weight {
    font-size: 2em;
    font-weight: bold;
    color: #3498db;
    margin: 10px 0;
    text-align: center;
}

.exercise-weight span {
    font-size: 0.5em;
    color: #7f8c8d;
}

.exercise-meta {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
}

.exercise-date {
    color: #7f8c8d;
}

.exercise-date i {
    margin-right: 5px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .exercise-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .exercise-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .exercise-header {
        flex-direction: column;
        text-align: center;
    }

    .exercise-weight {
        font-size: 1.8em;
    }
}

@media (max-width: 480px) {
    .exercise-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .exercise-card {
        padding: 15px;
    }

    .exercise-meta {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* Stats section enhancement */
.stats {
    display: flex;
    gap: 15px;
}

.stat-item {
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-item i {
    color: #3498db;
    font-size: 1.2em;
}

.stat-item span {
    font-weight: 500;
    color: #2c3e50;
}


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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #f8f9fa;
    color: #2c3e50;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    padding: 60px 0;
    text-align: center;
    margin-bottom: 40px;
}

.hero-small {
    padding: 40px 0;
}

.hero-content h1 {
    font-size: 2.5em;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-content p {
    font-size: 1.2em;
    opacity: 0.9;
    margin-top: 10px;
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    background: white;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-item i {
    color: #3498db;
    margin-right: 8px;
}

/* Grid Layout */
.records-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Record Cards */
.record-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    display: flex;
    gap: 20px;
}

.record-card:hover {
    transform: translateY(-5px);
}

.record-icon {
    background: #3498db;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
}

.record-details {
    flex: 1;
}

.record-details h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.record-weight {
    font-size: 1.5em;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 10px;
}

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

/* Timeline */
.timeline-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.timeline-group {
    margin-bottom: 40px;
}

.timeline-date {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-left: 45px;
}

.timeline-item {
    position: relative;
    padding-left: 45px;
    margin-bottom: 30px;
}

.timeline-marker {
    position: absolute;
    left: 0;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #3498db;
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px #3498db;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 24px;
    height: calc(100% + 15px);
    width: 2px;
    background: #e0e0e0;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-exercise {
    font-weight: bold;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-details {
    display: flex;
    gap: 20px;
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Forms and Inputs */
.login-form, .form-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 500px;
    margin: 0 auto;
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Buttons */
button {
    background-color: #3498db;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
}

button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.back-btn, .dashboard-btn, .history-btn, .logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    color: white;
    transition: all 0.3s;
}

.back-btn {
    background-color: #95a5a6;
}

.dashboard-btn {
    background-color: #2ecc71;
}

.history-btn {
    background-color: #3498db;
}

.logout-btn {
    background-color: #e74c3c;
}

.back-btn:hover, .dashboard-btn:hover, .history-btn:hover, .logout-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Status Badges */
.current-badge {
    background: #2ecc71;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.current-pb .timeline-marker {
    background: #2ecc71;
    box-shadow: 0 0 0 3px #2ecc71;
}

.current-pb .timeline-content {
    border-left: 4px solid #2ecc71;
}

/* Filter Controls */
.filter-container {
    margin-bottom: 20px;
}

.exercise-filter select {
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    width: 250px;
    appearance: none;
    background: white url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 15px center;
    background-size: 16px;
    transition: border-color 0.3s;
}

.exercise-filter select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Links */
.view-history-link {
    color: #3498db;
    text-decoration: none;
    font-size: 0.9em;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.view-history-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Messages */
.error, .success-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.success-message {
    background-color: #dcfce7;
    color: #166534;
    border-left: 4px solid #22c55e;
}

/* Empty States */
.no-records {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.no-records i {
    font-size: 3em;
    color: #bdc3c7;
    margin-bottom: 20px;
}

.no-records p {
    color: #7f8c8d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .hero {
        padding: 40px 0;
    }

    .hero-content h1 {
        font-size: 2em;
    }

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

    .action-bar {
        flex-direction: column;
        gap: 15px;
    }

    .nav-buttons {
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 10px;
    }

    .timeline-container {
        padding: 10px;
    }

    .timeline-details {
        flex-direction: column;
        gap: 10px;
    }

    .exercise-filter select {
        width: 100%;
    }
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
}

tr:hover {
    background-color: #f8f9fa;
}

/* Header Styles */
header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

/* Navigation */
.nav-buttons {
    display: flex;
    gap: 10px;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-10 {
    gap: 10px;
}
