:root {
    --primary-color: #8B5CF6;
    --secondary-color: #DDD6FE;
    --background-color: #FAF5FF;
    --text-color: #1F2937;
    --border-color: rgba(139, 92, 246, 0.2);
    --hover-color: #7C3AED;
    --navHeadHeight: 100px;
}

/* Common Layout */
body {
    margin: 0;
    background-color: var(--background-color);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    overflow-x: hidden;
    width: 100%;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--navHeadHeight));
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Navigation */
#navHead {
    width: 100%;
    height: var(--navHeadHeight);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    background-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    box-sizing: border-box;
}

#logoHead {
    width: 10vw;
    height: var(--navHeadHeight);
    background-color: var(--hover-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3ch;
    font-weight: 500;
    color: white;
    font-style: italic;
}

#navLink {
    display: flex;
    flex-direction: row;
    font-size: 1.3rem;
    font-weight: 500;
}

.navLink {
    width: 200px;
    height: var(--navHeadHeight);
    text-align: center;
    line-height: var(--navHeadHeight);
    background-color: var(--primary-color);
    color: white;
    transition: all 0.3s ease;
}

.navLink:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

/* Common Card Styles */
.card {
    background: linear-gradient(145deg, #ffffff, #f3e8ff);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.15);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.card:hover {
    transform: translateY(-5px);
    border: 2px solid var(--primary-color);
    box-shadow: 0 12px 20px rgba(139, 92, 246, 0.2);
}

/* Common Button Styles */
.btn-primary {
    min-width: 60px;
    padding: 10px 20px;
    border-radius: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(139, 92, 246, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: 0.5s;
}

.btn-primary:hover {
    background-color: var(--hover-color);
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover::before {
    left: 100%;
}

/* Common Text Styles */
.title {
    color: var(--text-color);
    font-size: clamp(1.5rem, 2.5vw + 1rem, 3rem);
    font-weight: 700;
    text-align: center;
    margin: 2vh 0;
}

.subtitle {
    color: var(--primary-color);
    font-size: clamp(1.2rem, 2vw + 0.5rem, 2.5rem);
    font-weight: 600;
    text-align: center;
}

/* Common Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal {
    background: white;
    border-radius: 20px;
    padding: 25px;
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.2);
    animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h2 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-color);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--primary-color);
}

.modal-content {
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px;
}

/* Shop Items Grid */
.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    padding: 10px;
}

.shop-item {
    background: linear-gradient(145deg, #ffffff, #f3e8ff);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 6px rgba(139, 92, 246, 0.1);
}

.shop-item:hover {
    transform: translateY(-5px);
    border: 2px solid var(--primary-color);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.2);
}

.flower, .item-icon {
    font-size: 4rem;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.shop-item:hover .flower,
.shop-item:hover .item-icon {
    transform: scale(1.1);
}

.item-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
}

.price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Garden Shop Button */
.shop-button {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(145deg, var(--primary-color), var(--hover-color));
    border: none;
    border-radius: 15px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.shop-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

/* Make sure modals are on top */
#seedShopModal, #gardenShopModal {
    z-index: 2000;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .garden-layout {
        grid-template-columns: 250px 1fr 250px;
        padding: 0 10px;
    }
}

@media (max-width: 992px) {
    .garden-layout {
        grid-template-columns: 1fr;
        padding: 0 10px;
    }
    .quest-area,
    .stats-area {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    #logoHead {
        width: 20vw;
    }

    .navLink {
        width: 150px;
    }
    #navHead {
        padding: 0 10px;
    }
    .garden-layout {
        padding: 0 5px;
    }
    .quest-list,
    .garden-grid,
    .plot-stats {
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    #logoHead {
        width: 30vw;
        font-size: 2.5ch;
    }

    .navLink {
        width: 100px;
        font-size: 1rem;
    }
}

/* Activity Page Styles */
#actContainer {
    margin-top: 5vh;
    width: 100%;
}

#actButton {
    display: flex;
    flex-direction: row;
    justify-content: center;
    margin: 0 auto;
    width: 30%;
    gap: 20px;
}

.actButt {
    position: relative;
    font-family: inherit;
    margin: 10px;
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.15);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.actButt:hover {
    transform: translateY(-5px);
    border: 2px solid var(--primary-color);
    box-shadow: 0 12px 20px rgba(139, 92, 246, 0.2);
}

.buttOne {
    min-width: 200px;
    min-height: 200px;
    max-height: 500px;
    max-width: 500px;
    height: 20vh;
    width: 20vh;
    line-height: 200px;
    text-align: center;
    border-radius: 20px;
    font-weight: 700;
    font-size: 6.5ch;
}

.buttTwo {
    max-width: 450px;
    min-width: 300px;
    width: 400px;
    height: 50px;
    line-height: 40px;
    text-align: center;
    border-radius: 20px;
    font-weight: 700;
    font-size: 3ch;
    margin-top: 3vh;
}

#titleGS {
    width: 100%;
    height: 100px;
    font-size: 4ch;
    font-weight: 500;
    text-align: center;
    margin-top: 3vh;
    color: var(--text-color);
}

/* Garden Page Styles */
.garden-container {
    margin-top: 3vh;
    padding: 20px;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Fix container spacing */
.container {
    margin-top: 50px;
    min-height: calc(100vh - var(--navHeadHeight));
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Fix navigation position */
#navHead {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

/* Garden Layout */
.garden-layout {
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 20px;
    box-sizing: border-box;
    padding: 0 20px;
}

.quest-area {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

/* Quest Container and Layout */
.quest-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 500px;
    background: linear-gradient(145deg, #ffffff, #f3e8ff);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.15);
    position: relative;
}

.quest-container h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-align: center;
}

.quest-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

/* Achievements Link - New Styles */
.quest-container > a {
    text-decoration: none;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.quest-container > a .achievements-link {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #FFD700, #FFA500);
    color: white;
    font-weight: 600;
    font-size: 1.1em;
    padding: 12px;
    border-radius: 12px;
    margin: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    cursor: pointer;
}

.quest-container > a .achievements-link:hover {
    background: linear-gradient(145deg, #FFE55C, #FFB52E);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.quest-container > a .achievements-link .trophy {
    font-size: 1.2em;
    margin-right: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Profile Styles */
#usernameText {
    margin-top: 20px;
    color: var(--text-color);
}

#heartsValue {
    color: var(--primary-color);
    margin: 20px 0;
}

#availabilityCounter {
    margin: 20px 0;
}

.userStorage {
    margin-bottom: 20px;
}

/* Profile Specific Styles */
#usernameText {
    font-size: 2rem;
    color: var(--text-color);
    text-align: center;
    margin: 20px 0;
}

#usernameText h2 {
    margin: 0;
    font-weight: 600;
}

#heartsValue {
    font-size: 4rem;
    text-align: center;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(139, 92, 246, 0.2);
    margin: 20px 0;
}

#availabilityCounter {
    width: 60vw;
    max-width: 1200px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 20px auto;
}

.userStorage {
    background: linear-gradient(145deg, #ffffff, #f3e8ff);
    border-radius: 20px;
    padding: 20px 30px;
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 300px;
    flex: 1;
    transition: all 0.3s ease;
}

.userStorage:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(139, 92, 246, 0.2);
}

.descArea {
    font-size: 1.2rem;
    color: var(--text-color);
}

.statusText {
    color: var(--primary-color);
    font-weight: 700;
    margin-left: 10px;
}

.addMore {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.addMore:hover {
    background-color: var(--hover-color);
    transform: scale(1.05);
}

.accountStatus .userStorage {
    width: 100%;
    max-width: none;
}

/* Garden Controls */
.garden-controls {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    max-width: 800px;/*me*/
    
}

.plot-navigation-buttons {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.plot-indicator {
    min-width: 150px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.nav-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #ccc;
}

.shop-button {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(145deg, var(--primary-color), var(--hover-color));
    border: none;
    border-radius: 15px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.shop-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

/* Shop Modal Styles */
.shop-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.shop-modal-content {
    background: white;
    margin: 10% auto;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    border-radius: 15px;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.modal-header h2 {
    margin: 0;
    color: var(--primary-color);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--primary-color);
}

.shop-items {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.shop-item {
    background: linear-gradient(145deg, #ffffff, #f3e8ff);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.shop-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

.shop-item > div:first-child {
    font-size: 3em;
    margin-bottom: 10px;
}

.shop-item > div:nth-child(2) {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 5px;
}

.shop-item > div:last-child {
    color: var(--primary-color);
    font-weight: bold;
}

/* Custom Dialog Styles */
.custom-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    backdrop-filter: blur(5px);
}

.custom-dialog-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.3s ease-out;
}

.custom-dialog-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.custom-dialog-button {
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.custom-dialog-button.save {
    background: var(--primary-color);
    color: white;
}

.custom-dialog-button.save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.custom-dialog-button.cancel {
    background: #f3f4f6;
    color: #374151;
}

.custom-dialog-button.cancel:hover {
    background: #e5e7eb;
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

#drawingCanvas {
    background-color: red; /* Test with a solid color */
}

/* Quest Notification Styles */
.quest-notification {
    max-width: 400px !important;
    text-align: center;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transform: scale(0.95);
    opacity: 0;
    animation: modalAppear 0.3s ease forwards;
}

.quest-notification h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.quest-complete-animation {
    font-size: 4rem;
    margin: 20px 0;
    opacity: 0;
    transform: scale(0.5);
    display: inline-block;
}

.quest-complete-animation.animate {
    animation: questComplete 0.6s ease forwards;
}

.reward-animation {
    font-size: 2rem;
    color: var(--primary-color);
    margin: 20px 0;
    opacity: 0;
    transform: translateY(20px);
    display: inline-block;
}

.reward-animation.animate {
    animation: rewardShow 0.6s ease 0.3s forwards;
}

@keyframes questComplete {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-15deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

@keyframes rewardShow {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalAppear {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Update modal overlay for quest notification */
#questNotificationModal.modal-overlay {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

/* Quest Category Styles */
.quest-category {
    margin-bottom: 25px;
}

.category-title {
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

/* Add box-sizing to all elements */
*, *::before, *::after {
    box-sizing: border-box;
}
