* {
    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: #e2e8f0;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    min-height: 100vh;
}

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

nav {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    color: white;
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(74, 144, 226, 0.3);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav h1 {
    font-size: 1.5rem;
}

nav h1 a {
    color: white;
    text-decoration: none;
}

nav .nav-links {
    display: flex;
    gap: 20px;
}

nav .nav-links a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav .nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.flash-messages {
    margin-bottom: 20px;
}

.flash-message {
    padding: 12px;
    background-color: #4CAF50;
    color: white;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Weight Chart */
.weight-chart-section {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    margin-bottom: 30px;
    border: 1px solid rgba(74, 144, 226, 0.3);
}

.weight-chart-section h2 {
    margin-bottom: 20px;
    color: #e2e8f0;
}

#weightChart {
    max-height: 400px;
}

/* Blog List */
.blogs-section {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(74, 144, 226, 0.3);
}

.blogs-section h2 {
    margin-bottom: 20px;
    color: #e2e8f0;
}

.blog-list {
    display: grid;
    gap: 20px;
}

.blog-card {
    padding: 20px;
    border: 1px solid rgba(74, 144, 226, 0.4);
    border-radius: 10px;
    background: rgba(45, 55, 72, 0.8);
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.blog-card:hover {
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
    transform: translateY(-2px);
    border-color: rgba(74, 144, 226, 0.6);
    background: rgba(45, 55, 72, 0.95);
}

.blog-card h3 {
    margin-bottom: 10px;
}

.blog-card h3 a {
    color: #e2e8f0;
    text-decoration: none;
}

.blog-card h3 a:hover {
    color: #90cdf4;
}

.blog-date {
    color: #a0aec0;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.blog-weight {
    color: #68d391;
    font-weight: 500;
}

/* Blog Post */
.blog-post {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(74, 144, 226, 0.3);
}

.blog-post h1 {
    color: #e2e8f0;
    margin-bottom: 20px;
}

.blog-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(74, 144, 226, 0.3);
}

.blog-meta .date {
    color: #a0aec0;
}

.blog-meta .weight {
    color: #68d391;
    font-weight: 500;
}

.blog-photo {
    margin: 30px 0;
}

.blog-photo img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.blog-content {
    font-size: 1.1rem;
    line-height: 1.8;
    white-space: pre-line;
    margin-bottom: 30px;
}

.back-link {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(74, 144, 226, 0.3);
}

.back-link a {
    color: #90cdf4;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Login Form */
.login-form {
    max-width: 400px;
    margin: 50px auto;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(74, 144, 226, 0.3);
}

.login-form h2 {
    margin-bottom: 30px;
    color: #e2e8f0;
    text-align: center;
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    background: rgba(26, 32, 44, 0.8);
    color: #e2e8f0;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(74, 144, 226, 0.6);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-group textarea {
    resize: vertical;
}

.login-form button,
.new-blog-form button {
    width: 100%;
    padding: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-form button:hover,
.new-blog-form button:hover {
    background-color: #2980b9;
}

/* Admin */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(74, 144, 226, 0.3);
}

.admin-header h2 {
    color: #e2e8f0;
}

.btn {
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #357abd 0%, #2a5f8f 100%);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.admin-blogs {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(74, 144, 226, 0.3);
}

.admin-blogs h3 {
    margin-bottom: 20px;
    color: #e2e8f0;
}

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

.blogs-table th,
.blogs-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(74, 144, 226, 0.3);
    color: #e2e8f0;
}

.blogs-table th {
    background-color: rgba(26, 32, 44, 0.8);
    font-weight: 600;
    color: #e2e8f0;
}

.blogs-table tr:hover {
    background-color: rgba(45, 55, 72, 0.6);
}

.blogs-table a {
    color: #90cdf4;
    text-decoration: none;
}

.blogs-table a:hover {
    text-decoration: underline;
}

/* New Blog Form */
.new-blog-form {
    max-width: 800px;
    margin: 0 auto;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(74, 144, 226, 0.3);
}

.new-blog-form h2 {
    margin-bottom: 30px;
    color: #e2e8f0;
}

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

.form-actions .btn {
    flex: 1;
}

/* Delete Button */
.btn-delete {
    padding: 8px 16px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.btn-delete:hover {
    background-color: #c0392b;
}

.actions-cell {
    display: flex;
    gap: 10px;
    align-items: center;
}

.actions-cell form {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    nav .container {
        flex-direction: column;
        gap: 15px;
    }
    
    nav h1 {
        font-size: 1.2rem;
    }
    
    nav .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .weight-chart-section,
    .blogs-section,
    .blog-post,
    .admin-header,
    .admin-blogs,
    .new-blog-form,
    .login-form {
        padding: 20px;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .admin-header .btn {
        width: 100%;
        text-align: center;
    }
    
    .blog-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .blogs-table {
        font-size: 0.9rem;
    }
    
    .blogs-table th,
    .blogs-table td {
        padding: 8px;
    }
    
    .blogs-table th:nth-child(2),
    .blogs-table td:nth-child(2) {
        display: none;
    }
    
    .actions-cell {
        flex-direction: column;
        gap: 5px;
    }
    
    .actions-cell a,
    .actions-cell .btn-delete {
        width: 100%;
        text-align: center;
        display: block;
    }
    
    .back-link {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .back-link form {
        margin-left: 0 !important;
        width: 100%;
    }
    
    .back-link .btn-delete {
        width: 100%;
    }
    
    #weightChart {
        max-height: 300px;
    }
    
    .blog-content {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 5px;
    }
    
    .weight-chart-section,
    .blogs-section,
    .blog-post,
    .admin-header,
    .admin-blogs,
    .new-blog-form,
    .login-form {
        padding: 15px;
    }
    
    .blog-post h1 {
        font-size: 1.5rem;
    }
    
    .blogs-table {
        font-size: 0.8rem;
    }
    
    .blogs-table th,
    .blogs-table td {
        padding: 6px 4px;
    }
    
    nav h1 {
        font-size: 1rem;
    }
    
    nav .nav-links a {
        padding: 5px 8px;
        font-size: 0.9rem;
    }
}

