/* --- Simply Flutter Website Stylesheet --- */
/* --- Final Version --- */

/* --- Table of Contents ---
1. Global Styles & Variables
2. Main Website UI (Modern Design)
3. Responsive Design for Main Website
4. Modern UI for Single Post Page (post.php)
5. Admin Panel UI V2 (Professional & Responsive)
   - Global Admin Styles
   - Login Page
   - Sidebar & Main Content
   - Dashboard Stats & Cards
   - Post & Message Lists
   - Forms
   - Responsive Admin Styles
---------------------------------*/

/* --- 1. Global Styles & Variables --- */
:root {
    --primary-color: #4CAF50;
    /* Main Green */
    --secondary-color: #2E7D32;
    /* Darker Green */
    --text-color: #333;
    --light-text: #555;
    --dark-blue-grey: #2c3e50;
    --light-bg: #f0f7f1;
    --border-color: #e0e0e0;
    --transition-speed: 0.3s ease;
    --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Padauk', sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: #ffffff;
    overflow-x: hidden;
    /* Prevents horizontal scrollbar from animations */
}

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

a {
    text-decoration: none;
    color: var(--primary-color);
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: bold;
    transition: background-color var(--transition-speed), transform var(--transition-speed), box-shadow var(--transition-speed);
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

section {
    padding: 80px 0;
    position: relative;
    overflow: hidden;
    /* Contain animations */
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 50px auto;
}

.section-title {
    font-size: 2.8rem;
    margin-bottom: 15px;
    color: var(--dark-blue-grey);
    font-weight: 700;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--light-text);
    line-height: 1.8;
}

/* --- 2. Main Website UI (Modern Design) --- */

/* Header */
.main-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(230, 230, 230, 0.8);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow var(--transition-speed);
}

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

.main-header .logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.main-nav {
    display: flex;
    align-items: center;
}

.main-nav ul {
    list-style: none;
    display: flex;
    padding: 0;
}

.main-nav ul li {
    margin-left: 30px;
}

.main-nav a {
    color: var(--dark-blue-grey);
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-speed);
}

.main-nav a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    /* Hidden on desktop */
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--dark-blue-grey);
    cursor: pointer;
    z-index: 1100;
    /* Ensure it's above nav */
}

/* Hero Section */
.hero-section {
    padding: 120px 0;
    color: #fff;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 20%);
    animation: rotate 25s linear infinite;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.2rem;
    max-width: 650px;
    margin: 0 auto 40px auto;
    opacity: 0.9;
}

.hero-cta-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-hero-primary {
    background: #fff;
    color: var(--primary-color);
}

.btn-hero-secondary {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}

.btn-hero-secondary:hover {
    background: #fff;
    color: var(--primary-color);
}

/* Services Section */
.services-section {
    background-color: #f0f7f1;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-medium);
}

.service-card .card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    line-height: 1;
    color: var(--primary-color);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--dark-blue-grey);
}

/* Blog Section */
.blog-section {
    background-color: var(--light-bg);
}

.blog-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(3, 1fr);
}

.blog-post-item {
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow-light);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.blog-post-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-medium);
}

.blog-post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-post-content {
    padding: 25px;
}

.blog-post-content h3 {
    margin-top: 0;
}

.read-more-link {
    font-weight: bold;
}

.load-more-container {
    text-align: center;
    margin-top: 40px;
}

/* Contact Section */
.contact-section {
    background-color: #fff;
}

.contact-wrapper-modern {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.contact-info-modern {
    padding: 50px;
    background: var(--dark-blue-grey);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.info-block {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.info-block:last-child {
    margin-bottom: 0;
}

.info-icon {
    font-size: 2rem;
    margin-right: 20px;
}

.info-text h4 {
    font-size: 1.2rem;
    margin: 0 0 5px 0;
    color: #fff;
}

.info-text p,
.info-text a {
    margin: 0;
    color: #bdc3c7;
    transition: color var(--transition-speed);
}

.info-text a:hover {
    color: #fff;
}

.contact-form-modern {
    padding: 50px;
}

.btn-full-width {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    background: var(--primary-color);
    color: #fff;
}

/* Footer */
.site-footer {
    background-color: var(--dark-blue-grey);
    color: #bdc3c7;
    padding: 60px 0 20px 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-about {
    flex: 2;
    min-width: 250px;
}

.footer-about h3 {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.footer-links {
    flex: 1;
    min-width: 150px;
}

.footer-links h3 {
    color: #ffffff;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #bdc3c7;
    transition: color var(--transition-speed), padding-left var(--transition-speed);
}

.footer-links a:hover {
    color: #ffffff;
    padding-left: 5px;
}

.footer-bottom {
    padding-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    border-top: 1px solid #34495e;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* --- 3. Responsive Design for Main Website --- */

/* Tablet View */
@media (max-width: 992px) {
    .section-title {
        font-size: 2.5rem;
    }

    .hero-title {
        font-size: 3rem;
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-wrapper-modern {
        grid-template-columns: 1fr;
    }
}

/* Mobile View */
@media (max-width: 768px) {
    .section-title {
        font-size: 2.2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .menu-toggle {
        display: block;
    }

    .main-nav ul {
        display: none;
        /* Hide nav links by default */
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 72px;
        /* Position below header */
        left: 0;
        background: white;
        padding: 20px 0;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }

    .main-nav ul.active {
        display: flex;
        /* Show when active */
    }

    .main-nav ul li {
        margin: 10px 20px;
        text-align: center;
    }

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


/* --- 4. Modern UI for Single Post Page (post.php) --- */
.single-post-page .post-hero {
    padding: 120px 0;
    background-size: cover;
    background-position: center;
    color: #fff;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 45vh;
}

.post-hero::before {
    /* Dark overlay for better text readability */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7));
}

.post-hero .container {
    position: relative;
    z-index: 2;
}

.single-post-page .post-title {
    font-size: 3.5rem;
    /* Desktop Font Size */
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    line-height: 1.2;
}

.single-post-page .post-meta {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: bold;
}

.post-content-container {
    padding: 80px 0;
    background: #fff;
}

.post-content-body {
    max-width: 750px;
    margin: 0 auto;
    font-size: 1.15rem;
    line-height: 1.9;
    color: #3a3a3a;
}

.post-content-body p {
    margin-bottom: 25px;
}

.post-content-body a {
    text-decoration: underline;
    color: var(--primary-color);
    font-weight: bold;
}

.back-to-blog-wrapper {
    max-width: 750px;
    margin: 60px auto 0 auto;
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

/* Outline button style for post page */
.btn.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn.btn-outline:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Responsive Styles for Post Page */
@media (max-width: 992px) {
    .single-post-page .post-title {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    .single-post-page .post-hero {
        min-height: 35vh;
        padding: 80px 0;
    }

    .single-post-page .post-title {
        font-size: 2.2rem;
    }

    .post-content-body {
        font-size: 1.1rem;
    }
}


/* --- 5. Admin Panel UI V2 (Professional & Responsive) --- */

/* Global Admin Styles */
.admin-dashboard-body {
    background-color: #f0f2f5;
    font-family: 'Padauk', sans-serif;
    display: flex;
}

.admin-wrapper {
    display: flex;
    width: 100%;
}

/* Login Page */
.admin-login-page {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-header {
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.login-header p {
    color: var(--light-text);
}

.login-form .input-group {
    position: relative;
    margin-bottom: 20px;
}

.login-form .input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.login-form .input-field {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    transition: border-color var(--transition-speed);
}

.login-form .input-field:focus {
    border-color: var(--primary-color);
    outline: none;
}

.login-form .btn-login {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    background: var(--primary-color);
    color: #fff;
}

.login-error {
    color: #D32F2F;
    margin-bottom: 15px;
    font-weight: bold;
}

.back-to-site {
    margin-top: 20px;
    font-size: 0.9rem;
}

/* Sidebar & Main Content */
.admin-sidebar {
    width: 250px;
    background: var(--dark-blue-grey);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform var(--transition-speed);
    position: fixed;
    height: 100%;
    z-index: 1001;
}

.sidebar-header {
    padding: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid #34495e;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #bdc3c7;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.sidebar-nav li a:hover {
    background: #34495e;
    color: #fff;
}

.sidebar-nav li.active a {
    background: var(--primary-color);
    color: #fff;
}

.sidebar-nav li a i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid #34495e;
}

.sidebar-footer a {
    color: #bdc3c7;
    display: flex;
    align-items: center;
}

.admin-main-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
    margin-left: 250px;
    /* Space for the sidebar */
    transition: margin-left var(--transition-speed);
}

.admin-header-main {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.admin-header-main h1 {
    font-size: 2rem;
    color: var(--dark-blue-grey);
    margin: 0;
}

.admin-header-main p {
    color: var(--light-text);
    margin-top: 5px;
}

.menu-toggle-admin {
    display: none;
    /* Hidden on desktop */
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--dark-blue-grey);
    cursor: pointer;
    margin-right: 15px;
}

/* Dashboard Stats & Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow-light);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    margin-right: 20px;
}

.stat-info .stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--dark-blue-grey);
}

.stat-info .stat-label {
    font-size: 0.9rem;
    color: var(--light-text);
}

.stat-icon.posts {
    background-color: #e3f2fd;
    color: #1e88e5;
}

.stat-icon.messages {
    background-color: #e0f2f1;
    color: #00796b;
}


.admin-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.admin-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow-light);
    overflow: hidden;
}

.admin-card h2 {
    font-size: 1.25rem;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    margin: 0;
}

.admin-card h2 i {
    margin-right: 10px;
}

.admin-card-body {
    padding: 20px;
}

/* Post & Message Lists */
#blog-posts-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.admin-post-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 15px;
}

.admin-post-item:last-child {
    border-bottom: none;
}

.post-thumbnail,
.post-thumbnail-placeholder {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
    /* Prevent image from shrinking */
}

.post-thumbnail-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f2f5;
    color: #ccc;
    font-size: 1.5rem;
}

.admin-post-item .post-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
    /* Prevent long text from breaking layout */
}

.admin-post-item .post-info .post-title {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-post-item .post-info .post-date {
    font-size: 0.85rem;
    color: #888;
}

.admin-post-item .post-actions {
    margin-left: auto;
    flex-shrink: 0;
}

.admin-post-item .post-actions .btn-edit,
.admin-post-item .post-actions .btn-delete {
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
    color: white;
    font-size: 0.8rem;
    margin-left: 5px;
    border: none;
    cursor: pointer;
}

.btn-edit {
    background-color: #2196F3;
}

.btn-edit:hover {
    background-color: #1976D2;
}

.btn-delete {
    background-color: #f44336;
}

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

/* Contact Message Accordion */
.message-accordion .message-item {
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-bottom: 10px;
}

.message-item-header {
    background: #f9f9f9;
    padding: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.message-item-header:hover {
    background: #f1f1f1;
}

.message-item-header h3 {
    font-size: 1rem;
    margin: 0;
    color: var(--dark-blue-grey);
}

.message-item-header .meta {
    font-size: 0.85rem;
    color: var(--light-text);
}

.message-item-body {
    padding: 20px;
    display: none;
    border-top: 1px solid var(--border-color);
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--light-text);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea,
.form-group input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
    outline: none;
}

.form-group .current-image-preview {
    max-width: 150px;
    margin-top: 10px;
    border-radius: 5px;
}

.btn.btn-primary-full {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 5px;
    background: var(--primary-color);
    color: #fff;
}

.status-message {
    margin-top: 15px;
    font-weight: bold;
    padding: 10px;
    border-radius: 5px;
    display: none;
}

.status-message.success {
    background: #e0f2f1;
    color: #00796b;
    display: block;
}

.status-message.error {
    background: #ffcdd2;
    color: #c62828;
    display: block;
}

/* Responsive Admin Styles */
@media (min-width: 992px) {
    .admin-content-grid {
        grid-template-columns: 1fr 1.5fr;
    }
}

@media (max-width: 991px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .admin-main-content {
        margin-left: 0;
    }

    .menu-toggle-admin {
        display: block;
    }

    .admin-content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-main-content {
        padding: 20px;
    }
}