/* Base Styles */
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f9f9f9;
    color: #333;
}

a {
    transition: all 0.2s ease;
}

/* Header */
header {
    background: #333;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1000;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: auto;
}

.brand {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2em;
    margin-right: 20px;
}

.menu-toggle {
    display: none;
    /* Hidden on desktop */
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px;
}

header nav {
    display: flex;
    align-items: center;
}

header nav a {
    margin-right: 15px;
    color: #ddd;
    text-decoration: none;
    font-weight: 500;
}

header nav a:hover {
    color: #fff;
    text-decoration: none;
}

.user-info-desktop {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info-mobile {
    display: none;
    /* Hidden on desktop */
}

.avatar {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    object-fit: cover;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    background: #4285F4;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
}

.btn:hover {
    background: #3367D6;
    transform: translateY(-1px);
}

.btn-logout {
    background: #DB4437;
}

.btn-logout:hover {
    background: #C33D2E;
}

/* Main Layout */
main {
    flex: 1;
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.sidebar {
    width: 250px;
    background: white;
    padding: 20px;
    border-right: 1px solid #eee;
}

.content {
    flex: 1;
    padding: 30px;
    background: white;
}

/* Sidebar Specifics */
.sidebar h3 {
    margin-top: 0;
    font-size: 1.1em;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar li {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dotted #eee;
}

/* Footer */
footer {
    background: #222;
    color: #aaa;
    text-align: center;
    padding: 20px;
    font-size: 0.9em;
    margin-top: auto;
}

/* Snippet View Styles */
.snippet-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.meta {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.code-block {
    background: #282c34;
    color: #abb2bf;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    font-size: 0.9em;
    line-height: 1.5;
}

.stats {
    margin-top: 20px;
    display: flex;
    gap: 20px;
    border-top: 1px solid #eee;
    padding-top: 15px;
    flex-wrap: wrap;
    justify-content: space-around;
}

.stat-box {
    text-align: center;
    min-width: 60px;
}

.stat-val {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

.stat-label {
    font-size: 0.8em;
    color: #777;
}

.actions-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Additional Button Colors */
.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #bd2130;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
    }

    .header-main {
        padding: 10px 20px;
        width: 100%;
        box-sizing: border-box;
        display: flex;
        justify-content: space-between;
        background: #333;
        /* Ensure header bg covers full width */
    }

    .brand {
        margin-right: 0;
    }

    .menu-toggle {
        display: block;
    }

    header nav {
        display: none;
        /* Hidden by default */
        flex-direction: column;
        width: 100%;
        background: #444;
        padding: 10px 0;
    }

    header nav.active {
        display: flex;
        animation: fadeIn 0.3s;
    }

    header nav a {
        display: block;
        padding: 10px 20px;
        margin: 0;
        border-bottom: 1px solid #555;
        width: 100%;
        box-sizing: border-box;
        color: #eee;
    }

    header nav a:hover {
        background: #555;
        color: #fff;
    }

    header nav a:last-child {
        border-bottom: none;
    }

    .user-info-desktop {
        display: none !important;
    }

    .user-info-mobile {
        display: block;
        border-top: 1px solid #555;
        margin-top: 5px;
        padding-top: 10px;
    }

    .user-info-mobile a.btn-logout {
        background: none;
        color: #ff6b6b;
        text-align: left;
        padding-left: 20px;
    }

    .btn-google-mobile {
        display: block;
        background: #fff;
        color: #333;
        padding: 10px;
        margin: 10px 20px;
        text-align: center;
        border-radius: 4px;
        text-decoration: none;
    }

    main {
        flex-direction: column;
        padding: 15px;
    }

    .sidebar {
        width: auto;
        border-right: none;
        border-bottom: 1px solid #ddd;
        padding: 15px;
        margin-bottom: 15px;
    }

    .content {
        padding: 0;
    }

    /* Stats grid for mobile */
    .stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}