*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background: #eef1f6;
    margin: 0;
    font-family: 'DM Sans', Georgia, sans-serif;
    color: #1f2b34;
    min-height: 100vh;
}

.sidebar {
    width: 100%;
    background: linear-gradient(90deg, #1f2b34 0%, #2C4251 100%);
    color: white;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    box-shadow: 0 2px 12px rgba(0,0,0,0.22);
    position: relative;
    z-index: 200;
}

.logo-title {
    display: flex;
    align-items: center;
    font-size: 17px;
    margin: 0;
    color: white;
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: normal;
    gap: 8px;
}

.logo {
    height: 36px;
    width: auto;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.topbar-right {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.avatar {
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
    width: 36px;
    height: 36px;
    border: 2px solid rgba(255,255,255,0.3);
    transition: border-color 0.2s;
    flex-shrink: 0;
}

.avatar:hover {
    border-color: #b6c649;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    min-width: 140px;
    z-index: 300;
    padding: 6px 0;
    overflow: hidden;
}

.avatar-menu.active {
    display: flex;
}

.menu-item {
    padding: 10px 18px;
    font-size: 14px;
    color: #1f2b34;
    cursor: pointer;
    transition: background 0.15s;
    font-family: 'DM Sans', Georgia, sans-serif;
}

.menu-item:hover {
    background: #f0f4f8;
    color: #2C4251;
}

#greeting {
    display: flex;
    flex-direction: column;
}

#greeting1 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 22px;
    margin: 0;
    color: white;
    letter-spacing: -0.3px;
}

#username {
    color: #b6c649; 
}

#greeting2 {
    color: rgba(255,255,255,0.6);
    font-weight: 300;
    margin: 2px 0 0;
    font-size: 13px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
    cursor: pointer;
    transition: border-color 0.2s;
}

.nav-avatar:hover {
    border-color: #b6c649;
}

.nav-hamburger {
    position: relative;
    display: flex;
    align-items: center;
}

.menu-toggle {
    font-size: 22px;
    cursor: pointer;
    color: #c1c1c1;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.2s;
    user-select: none;
}

.menu-toggle:hover {
    color: white;
}

.nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    background-color: #fff;
    padding: 10px;
    border-radius: 8px;
    flex-direction: column;
    gap: 4px;
    list-style: none;
    margin: 0;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    z-index: 400;
}

.nav-links li { display: block; }

.nav-links.active {
    display: flex;
}
.nav-links a {
    text-decoration: none;
    color: black;
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    transition: 0.3s;
}

.nav-links a:hover {
    background-color: #b6c649;
    color: #fff;
    transform: translateX(3px);
}

.nav-links .nav-item{
    color: black;
    cursor: pointer;
}

.nav-item{
    padding: 5px 0;
}

.nav-item:not(:last-child){
    border-bottom: solid 2px;
    border-color: #c1c1c1;
    border-bottom-width: 2px;
}

.nav-item:hover {
    text-decoration: underline;
}

.hero {
    background: linear-gradient(to top, #2C4251 0%, #3d5a6e 55%, #4a6d82 100%);
    padding: 36px 24px 44px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

#main-logo {
    display: block;
    margin: 0 auto 12px;
    width: 180px;
    max-width: 60vw;
    height: auto;
    position: relative;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.25));
}

#main-logo:hover {
    animation: logoVibrate 0.75s linear infinite;
    transform: scale(1.1);
}

@keyframes logoVibrate { 
    0%   { transform: rotate(0deg); }
    25%  { transform: rotate(0.5deg); }
    50%  { transform: rotate(0.5deg); }
    75%  { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

.hero-sub {
    color: rgba(255,255,255,0.65);
    font-size: 14px;
    margin: 0;
    position: relative;
    letter-spacing: 0.03em;
}

.hero-banner {
    display: block;
    width: 100%;
    max-width: 700px;
    height: auto;
    border-radius: 8px;
    margin-top: 14px;
    opacity: 0.85;
}

.logo-float {
    float: left;
    margin-right: 10px;
}

.clearfix::after {
    content: "";
    display: block;
    clear: both;
}

.hero .logo-float {
    float: none;
    margin: 0;
    display: block;
}

.projects-section {
    max-width: 1060px;
    margin: 0 auto;
    padding: 36px 24px 64px;
}

.section-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 18px;
}

.section-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 26px;
    color: #1f2b34;
    margin: 0;
    letter-spacing: -0.3px;
}

.project-count {
    font-size: 13px;
    color: #8a9bb0;
    font-weight: 400;
}

.search-wrapper {
    position: relative;
    margin-bottom: 24px;
}

.search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aafbe;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
}

.search-icon svg {
    width: 16px;
    height: 16px;
}

#searchBar {
    width: 100%;
    padding: 11px 14px 11px 40px; 
    font-size: 14px;
    font-family: 'DM Sans', Georgia, sans-serif;
    border: 1.5px solid #d4dce6;
    border-radius: 9px;
    background: white;
    color: #1f2b34;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

#searchBar:focus {
    border-color: #2C4251;
    box-shadow: 0 0 0 3px rgba(44,66,81,0.1);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); 
    gap: 16px;
    margin-bottom: 20px;
}

.project-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    outline: 2px solid transparent;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(44,66,81,0.14);
    outline-color: var(--card-border-color); 
}

.card-accent {
    height: 5px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #4a7fc1, #2C4251);
}

.card-accent--blue   { background: linear-gradient(135deg, #4a7fc1, #2a5a9e); }
.card-accent--lime   { background: linear-gradient(135deg, #b6c649, #8fad00); }
.card-accent--coral  { background: linear-gradient(135deg, #e8805a, #c45a30); }
.card-accent--purple { background: linear-gradient(135deg, #9b7ed4, #6a4cbf); }
.card-accent--navy   { background: linear-gradient(135deg, #2C4251, #1a2b38); }
.card-accent--teal   { background: linear-gradient(135deg, #4caf8a, #2e8a65); }

.project-card:has(.card-accent--blue) {
    --card-border-color: #4a7fc1;
}

.project-card:has(.card-accent--lime) {
    --card-border-color: #b6c649;
}

.project-card:has(.card-accent--coral) {
    --card-border-color: #e8805a;
}

.project-card:has(.card-accent--purple) {
    --card-border-color: #9b7ed4;
}

.project-card:has(.card-accent--navy) {
    --card-border-color: #2C4251;
}

.project-card:has(.card-accent--teal) {
    --card-border-color: #4caf8a;
}

.card-body {
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon-wrap svg {
    width: 18px; height: 18px;
}

.card-icon-wrap--blue   { background: #e8f0fb; color: #4a7fc1; }
.card-icon-wrap--lime   { background: #f3f7e0; color: #8fad00; }
.card-icon-wrap--coral  { background: #fdf0eb; color: #c45a30; }
.card-icon-wrap--purple { background: #f2edfb; color: #6a4cbf; }
.card-icon-wrap--navy   { background: #e4eaef; color: #2C4251; }
.card-icon-wrap--teal   { background: #e0f4ee; color: #2e8a65; }

.card-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 99px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: #e8f0fb;
    color: #3a6aa8;
}

.card-tag--blue   { background: #e8f0fb; color: #3a6aa8; }
.card-tag--lime   { background: #f0f6c8; color: #5e7a00; }
.card-tag--coral  { background: #fde8df; color: #a03c14; }
.card-tag--purple { background: #ede8fb; color: #4e30a0; }
.card-tag--navy   { background: #e4eaef; color: #1a2b38; }
.card-tag--teal   { background: #e0f4ee; color: #1e6646; }

.card-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 18px;
    margin: 0 0 5px;
    color: #1f2b34;
}

.card-desc {
    font-size: 12px;
    color: #7a8c9a;
    margin: 0 0 14px;
    line-height: 1.5;
    flex: 1;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.card-members {
    display: flex;
    gap: 3px;
}

.member-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: white;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.member-dot--blue   { background: #4a7fc1; }
.member-dot--lime   { background: #b6c649; }
.member-dot--coral  { background: #e8805a; }
.member-dot--purple { background: #9b7ed4; }
.member-dot--navy   { background: #2C4251; }
.member-dot--teal   { background: #4caf8a; }
.member-dot--more   { background: #d0d8e4; color: #4a5e6d; font-size: 8px; } 

.card-date {
    font-size: 11px;
    color: #9aafbe;
}

.create-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 16px 22px;
    background: white;
    border: 2px dashed #b6c649; 
    border-radius: 14px;
    color: #5a7000;
    font-family: 'DM Sans', Georgia, sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.15s;
    margin-top: 8px;
}

.create-btn-gif {
    width: 35px;
    height: 35px;
    object-fit: contain;
    margin-left: auto;
}

.create-btn:hover {
    background: #f8fae8;
    border-color: #8fad00;
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 10px 24px rgba(143, 173, 0, 0.22);
}

.create-plus {
    width: 30px;
    height: 30px;
    background: #b6c649;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.2s;
}

.create-btn:hover .create-plus {
    background: #8fad00;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,25,35,0.55);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
    backdrop-filter: blur(3px);
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 28px 24px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.22);
    animation: popIn 0.22s ease;
}

@keyframes popIn { /*bouncy open animation*/
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #aab8c4;
    line-height: 1;
    transition: color 0.15s;
}

.modal-close:hover {
    color: #333;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.modal-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #2C4251, #4a6d82);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.modal-icon svg {
    width: 20px; height: 20px;
}

.modal-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 20px;
    margin: 0 0 2px;
    color: #1f2b34;
}

.modal-subtitle {
    font-size: 12px;
    color: #8a9bb0;
    margin: 0;
}

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

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #7a8c9a;
    margin-bottom: 6px;
}

.required {
    color: #e05c4a; 
}

.form-input {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid #dde3ea;
    border-radius: 8px;
    font-family: 'DM Sans', Georgia, sans-serif;
    font-size: 14px;
    color: #1f2b34;
    background: #f7f9fb;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: #2C4251;
    background: white;
    box-shadow: 0 0 0 3px rgba(44,66,81,0.09);
}

.form-textarea {
    resize: vertical;
    min-height: 72px;
}

.form-select {
    cursor: pointer;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.member-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.member-input-row .form-input {
    flex: 1;
    margin: 0;
}

.add-member-btn {
    padding: 10px 14px;
    background: #2C4251;
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', Georgia, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
}

.add-member-btn:hover {
    background: #1f2b34;
}

.member-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 4px;
}

.member-chip { 
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e8eef5;
    color: #2C4251;
    border-radius: 99px;
    padding: 4px 10px 4px 12px;
    font-size: 12px;
    font-weight: 600;
    animation: chipIn 0.18s ease;
}

@keyframes chipIn { 
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

.chip-remove { 
    background: none;
    border: none;
    cursor: pointer;
    color: #7a9bb0;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.chip-remove:hover {
    color: #c62828;
}

.color-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    outline: none;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.selected {
    border-color: #1f2b34; 
    transform: scale(1.1);
}

.color-swatch--blue   { background: #4a7fc1; }
.color-swatch--lime   { background: #b6c649; }
.color-swatch--coral  { background: #e8805a; }
.color-swatch--purple { background: #9b7ed4; }
.color-swatch--navy   { background: #2C4251; }
.color-swatch--teal   { background: #4caf8a; }

.form-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #2C4251, #3d5a6e);
    color: white;
    border: none;
    border-radius: 9px;
    font-family: 'DM Sans', Georgia, sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    box-shadow: 0 3px 10px rgba(44,66,81,0.3);
    margin-top: 8px;
    letter-spacing: 0.02em;
}

.form-submit:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.card-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: white;
    border: 1.5px solid #e0e6ed;
    border-radius: 6px;
    cursor: pointer;
    color: #aab8c4;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, border-color 0.15s, background 0.15s;
    z-index: 10;
}

.card-delete-btn svg {
    width: 14px; height: 14px;
}

.project-card:hover .card-delete-btn {
    opacity: 1;
}

.card-delete-btn:hover {
    color: #c62828;
    border-color: #f5c6c6;
    background: #fff5f5;
}

.card-body { position: relative; } 

.project-card--demo {
    cursor: pointer;
    outline: 2px solid transparent;
    transition: transform 0.2s, box-shadow 0.2s, outline-color 0.2s;
}

.project-card--demo:hover {
    outline-color: #4a7fc1;
}

.project-card--demo .card-title::after {
    content: " \2192";
    font-size: 14px;
    color: #4a7fc1;
    opacity: 0;
    transition: opacity 0.15s;
}

.project-card--demo:hover .card-title::after {
    opacity: 1;
}

@media (max-width: 768px) {
    #main-logo { width: 240px; }
    .project-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .sidebar { padding: 12px 16px; }
    .hero { padding: 28px 16px 36px; }
    .projects-section { padding: 24px 16px 48px; }
}

@media (max-width: 480px) {
    #greeting1 { font-size: 16px; }
    #greeting2 { font-size: 12px; }
    #main-logo { width: 180px; }
    .project-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; gap: 0; }
    .modal-box { padding: 20px 18px 18px; }
}

.site-footer {
    text-align: center;
    padding: 24px 20px;
    margin-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: #2C4251;
}

.footer-text {
    color: rgba(255,255,255,0.45);
    font-size: 12px;
    margin: 0 0 10px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 24px;
}

.footer-links li a {
    color: #4a7fc1;
    font-size: 12px;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links li a:hover {
    color: rgb(182, 199, 74);
    text-decoration: underline;
}

/* dark mode */
body.dark { background: #1a2330; color: #e0e0e0; }

body.dark .sidebar { background: linear-gradient(90deg, #0a1018 0%, #0f1923 100%); }
body.dark #greeting1 { color: #e0e0e0; }
body.dark #greeting2 { color: #8a9bb0; }

body.dark .hero { background: linear-gradient(to top, #0d141d 0%, #1a2330 100%); }
body.dark .hero-sub { color: #8a9bb0; }

body.dark .nav-links { background-color: #1e2d3d; }
body.dark .nav-links a { color: #ccd6e0; }

body.dark .section-title { color: #e0e0e0; }
body.dark .project-count { color: #8a9bb0; }

body.dark .search-wrapper { background: #243040; border-color: #344558; }
body.dark #searchBar { background: #243040; color: #e0e0e0; border-color: #344558; }

body.dark .project-card { background: #243040; box-shadow: 0 2px 16px rgba(0,0,0,0.35); }
body.dark .card-title { color: #e0e0e0; }
body.dark .card-desc  { color: #8a9bb0; }
body.dark .card-date  { color: #6a8aaa; }

body.dark .modal-box     { background: #243040; }
body.dark .modal-title   { color: #e0e0e0; }
body.dark .modal-subtitle { color: #8a9bb0; }
body.dark .form-label    { color: #8a9bb0; }
body.dark .form-input,
body.dark .form-textarea,
body.dark .form-select   { background: #1a2330; color: #e0e0e0; border-color: #344558; }
body.dark .form-input:focus,
body.dark .form-textarea:focus { border-color: #4a7fc1; background: #1e2d3d; }
body.dark .add-member-btn { background: #344558; color: #ccd6e0; }

body.dark .site-footer { background: #0f1923; border-top: 1px solid #344558; }
body.dark .footer-text { color: #6a8aaa; }
body.dark .footer-links li a { color: #8a9bb0; }
body.dark .logo { mix-blend-mode: screen; opacity: 0.9; }
body.dark .avatar-menu { background: #1e2d3d; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
body.dark .menu-item { color: #ccd6e0; }
body.dark .menu-item:hover { background: #243040; }
