/* Kisii University Post Management System Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.main-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.university-branding h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.university-branding p {
    font-size: 0.9rem;
    opacity: 0.9;
    font-style: italic;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.main-nav a:hover {
    background-color: rgba(255,255,255,0.1);
}

.admin-link {
    background-color: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
}

.announcements-section {
    padding: 3rem 0;
}

.announcements-section h2 {
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 2rem;
    color: #2c3e50;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.post-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.post-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-content {
    padding: 1.5rem;
}

.post-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-weight: 600;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-excerpt {
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.read-more {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.read-more:hover {
    opacity: 0.9;
}

/* Post Detail Styles */
.post-detail {
    background: white;
    border-radius: 10px;
    padding: 2.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.post-header {
    margin-bottom: 2rem;
    text-align: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 1.5rem;
}

.post-detail .post-title {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.post-detail .post-meta {
    justify-content: center;
    gap: 1.5rem;
}

.post-featured-image {
    margin-bottom: 2rem;
    text-align: center;
}

.post-featured-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.post-detail .post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 2rem;
}

.post-footer {
    border-top: 1px solid #eee;
    padding-top: 1.5rem;
    text-align: center;
}

.back-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

/* No Posts Message */
.no-posts {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.no-posts h3 {
    color: #666;
    margin-bottom: 1rem;
}

/* Footer */
.main-footer {
    background: #2c3e50;
    color: white;
    padding: 2rem 0 1rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #ecf0f1;
}

.footer-section p {
    line-height: 1.6;
    color: #bdc3c7;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #ecf0f1;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #34495e;
    color: #bdc3c7;
}

/* Login Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.university-header {
    text-align: center;
    margin-bottom: 2rem;
}

.university-header h1 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.university-header p {
    color: #666;
    font-size: 1.1rem;
}

.login-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.login-btn,
.submit-btn {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.login-btn:hover,
.submit-btn:hover {
    opacity: 0.9;
}

.login-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.login-info strong {
    color: #2c3e50;
}

/* Admin Dashboard Styles */
.admin-container {
    min-height: 100vh;
    background: #f8f9fa;
}

.admin-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.3);
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

.admin-nav {
    background: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.admin-nav a {
    color: #2c3e50;
    text-decoration: none;
    padding: 0.5rem 1rem;
    margin-right: 1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.admin-nav a:hover {
    background: #f8f9fa;
}

.admin-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 20px;
}

/* Post Form Styles */
.post-form-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.post-form-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
}

.post-form textarea {
    min-height: 120px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.cancel-btn {
    color: #666;
    text-decoration: none;
    padding: 0.8rem 1.2rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: #f8f9fa;
    border-color: #bbb;
}

/* Posts Management Styles */
.posts-management {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.posts-management h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
}

.posts-table-container {
    overflow-x: auto;
}

.posts-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.posts-table th,
.posts-table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.posts-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.post-title {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-published {
    background: #d4edda;
    color: #155724;
}

.status-draft {
    background: #fff3cd;
    color: #856404;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.edit-btn,
.delete-btn {
    padding: 0.4rem 0.8rem;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: opacity 0.3s ease;
}

.edit-btn {
    background: #007bff;
    color: white;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.edit-btn:hover,
.delete-btn:hover {
    opacity: 0.8;
}

.no-posts {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

/* Message Styles */
.success-message,
.error-message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .university-branding h1 {
        font-size: 1.8rem;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .post-detail {
        padding: 1.5rem;
        margin: 1rem 0;
    }
    
    .post-detail .post-title {
        font-size: 1.8rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .submit-btn,
    .form-actions .cancel-btn {
        width: 100%;
    }
    
    .admin-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .posts-table {
        font-size: 0.9rem;
    }
    
    .actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container,
    .admin-main {
        padding: 0 10px;
    }
    
    .login-box {
        padding: 2rem 1.5rem;
    }
    
    .post-form-section,
    .posts-management {
        padding: 1.5rem;
    }
}
