/* Reset & Base */
:root {
    --primary-color: #3498db;
    --text-color: #333;
    --bg-color: #f4f7f6;
    --sidebar-bg: #2c3e50;
    --sidebar-text: #ecf0f1;
    --card-bg: #fff;
    --card-shadow: 0 2px 5px rgba(0,0,0,0.1);
    --sidebar-width: 250px;
    --header-height: 60px;
    --transition-speed: 0.3s;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Layout */
#app {
    display: flex;
    min-height: 100vh;
}

/* Mobile Header */
#mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 1000;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    padding: 0;
    margin-right: 20px;
}

#menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--sidebar-text);
    border-radius: 2px;
    transition: var(--transition-speed);
}

#mobile-header .logo {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Sidebar */
#sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    z-index: 1100;
    transition: transform var(--transition-speed) ease-in-out;
    overflow-y: auto;
}

.sidebar-header {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header .logo {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.sidebar-header .subtitle {
    font-size: 0.9rem;
    opacity: 0.7;
}

.nav-links {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: block;
    padding: 15px 25px;
    color: rgba(255,255,255,0.7);
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(255,255,255,0.05);
    color: #fff;
    border-left-color: var(--primary-color);
}

.sidebar-footer {
    padding: 20px;
    font-size: 0.8rem;
    text-align: center;
    opacity: 0.5;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Overlay */
#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1050;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

#overlay.active {
    display: block;
    opacity: 1;
}

/* Main Content */
#content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 40px;
    min-height: 100vh;
    transition: margin-left var(--transition-speed);
}

/* Cards Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

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

.card-header {
    padding: 20px;
    background-color: #fff;
    border-bottom: 1px solid #eee;
    position: relative;
}

.card-header.has-bg {
    color: #fff;
    background-size: cover;
    background-position: center;
}

.card-header.has-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5); /* Dark overlay for readability */
    z-index: 1;
}

.card-header h2, .card-header p {
    position: relative;
    z-index: 2;
}

.card-header h2 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.card-header p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-content: flex-start;
}

.link-btn {
    display: inline-block;
    padding: 6px 12px;
    background-color: #f0f2f5;
    color: #555;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.2s, color 0.2s;
    text-align: center;
    text-decoration: none;
}

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

.social-container {
    max-width: 800px;
    margin: 0 auto 20px;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

.social-header {
    text-align: center;
    margin-bottom: 20px;
}

.social-header h2 {
    color: #2c3e50;
    margin-bottom: 6px;
}

.social-header p {
    color: #6c7a89;
    font-size: 0.95rem;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e7ebf0;
    border-radius: 10px;
    background: #fafbfd;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.social-link:hover {
    transform: translateY(-2px);
    border-color: #c8d9eb;
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.12);
}

.social-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    flex-shrink: 0;
}

.social-link span {
    color: #34495e;
    font-weight: 600;
    font-size: 0.95rem;
}

/* About Page Styles */
.about-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

.about-header {
    text-align: center;
    margin-bottom: 40px;
}

.about-header img {
    width: 120px;
    border-radius: 50%;
    margin-bottom: 20px;
}

.about-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
}

.about-content p {
    margin-bottom: 20px;
}

.about-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Log Page Styles */
.log-container {
    max-width: 900px;
}

.log-header h1 {
    margin: 0;
}

.log-content {
    font-size: 1rem;
    line-height: 1.85;
}

.log-content > p {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eef1f4;
}

.log-content > p:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.log-content strong {
    color: #2c3e50;
}

/* Image Map Container */
#img-container {
    position: relative;
    margin: 40px auto;
    width: 300px; /* Scaled down for mobile/desktop consistency */
    height: auto;
}

#img-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    #mobile-header {
        display: flex;
    }

    #sidebar {
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }

    #sidebar.open {
        transform: translateX(0);
    }

    #content {
        margin-left: 0;
        padding: 20px;
        padding-top: calc(var(--header-height) + 20px);
    }

    .grid-container {
        grid-template-columns: 1fr; /* Single column on mobile */
    }
    
    .about-container {
        padding: 20px;
    }

    .social-container {
        padding: 20px;
    }

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