:root {
    --primary: #FF6B6B;
    --secondary: #FF8E8E;
    --accent: #FFD166;
    --accent2: #06D6A0;
    --background: #FDF0F0;
    --card-bg: #FFFFFF;
    --text: #3D3D3D;
    --text-light: #777777;
    --shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%);
}

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

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    padding: 0;
    margin: 0;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255, 214, 102, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(6, 214, 160, 0.1) 0%, transparent 20%);
}

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

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

.title {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    padding: 0 20px;
    position: relative;
}

.title::before, .title::after {
    content: "✨";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.title::before {
    left: -10px;
}

.title::after {
    right: -10px;
}

/* Birthday cake animation */
.birthday-cake {
    margin: 50px auto;
    margin-bottom: 10px;
    width: 100px;
    height: 120px;
    position: relative;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.cake {
    position: relative;
    width: 100px;
    height: 60px;
}

.plate {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 10px;
    background: #E0E0E0;
    border-radius: 50%;
}

.layer {
    position: absolute;
    width: 100%;
    border-radius: 10px 10px 0 0;
}

.layer-bottom {
    bottom: 0;
    height: 40px;
    background: #F8B195;
}

.layer-middle {
    bottom: 35px;
    height: 30px;
    background: #F67280;
    width: 90%;
    left: 5%;
}

.layer-top {
    bottom: 60px;
    height: 20px;
    background: #C06C84;
    width: 80%;
    left: 10%;
}

.icing {
    position: absolute;
    bottom: 75px;
    width: 80%;
    height: 10px;
    background: #FFF;
    left: 10%;
    border-radius: 5px;
}

.candle {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 25px;
    background: #FFD166;
    z-index: 10;
}

.flame {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 20px;
    background: #FFAC33;
    border-radius: 50% 50% 20% 20%;
    box-shadow: 0 0 15px #FFAC33, 0 0 30px #FFD166;
    animation: flicker 1.5s ease-in-out infinite alternate;
}

@keyframes flicker {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
    50% { transform: translateX(-50%) scale(0.9); opacity: 0.8; }
    80% { transform: translateX(-50%) scale(1.1); opacity: 1; }
}

/* Form styles */
.add-item-form {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    transition: transform 0.3s ease;
}

.add-item-form:hover {
    transform: none;
}

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

.fancy-input {
    width: 100%;
    padding: 15px 20px 15px 45px;
    border: 2px solid #E0E0E0;
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.8);
}

.fancy-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}

.input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
}

.desire-slider {
    margin: 25px 0;
}

.desire-slider label {
    display: block;
    margin-bottom: 10px;
    color: var(--text);
    font-weight: 600;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.styled-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, #FFD166, #FF6B6B);
    outline: none;
    flex-grow: 1;
}

.styled-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.styled-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: var(--secondary);
}

#desireValue {
    min-width: 40px;
    text-align: center;
    font-weight: bold;
    color: var(--primary);
}

.fancy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    position: relative;
    overflow: hidden;
}

.fancy-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.fancy-button:active {
    transform: translateY(1px);
}

.fancy-button i {
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.fancy-button:hover i {
    transform: rotate(45deg);
}

.fancy-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0) 45%,
        rgba(255, 255, 255, 0.3) 48%,
        rgba(255, 255, 255, 0) 52%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    transition: all 0.5s ease;
}

.fancy-button:hover::after {
    left: 100%;
}

/* Graph styles */
.graph-container {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    height: 70vh;
    min-height: 600px;
    width: 100%;
    transition: transform 0.3s ease;
}

.graph-wrapper {
    height: calc(100% - 60px);
    position: relative;
}

.admin-only {
    display: none;
}

.graph-container:hover {
    transform: translateY(-5px);
}

.graph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.graph-header h2 {
    color: var(--primary);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.graph-legend {
    display: flex;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: var(--primary);
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.color-dot.price {
    background: var(--primary);
}

.color-dot.desire {
    background: var(--accent);
}

/* Items list styles */
.items-list {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.items-list:hover {
    transform: none;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.list-header h2 {
    color: var(--primary);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.total-items {
    background: rgba(255, 107, 107, 0.1);
    padding: 8px 15px;
    border-radius: 50px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    overflow: visible;
}

#itemsList {
    list-style: none;
}

.item {
    position: relative;
    background: var(--card-bg);
    border-radius: 15px;
    border: 1px solid #eee;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
    overflow: hidden;
    padding: 25px;
    
    display: grid;
    grid-template-columns: 300px 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 20px;
    height: 250px;
}

.item:hover {
    transform: none;
}

.item-header {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.item-image-wrapper {
    grid-column: 1;
    grid-row: 1 / -1;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.9rem;
    text-align: center;
    padding: 20px;
    background: #f5f5f5;
}

.item-description {
    grid-column: 2;
    grid-row: 2;
    overflow-y: auto;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-light);
}

.item-actions {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.edit-btn, .delete-btn {
    padding: 10px;
    border-radius: 50%;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-btn {
    background: rgba(255, 209, 102, 0.1);
    color: var(--accent);
}

.edit-btn:hover {
    transform: scale(1.2);
    background: rgba(255, 209, 102, 0.2);
}

.delete-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 10px;
    border-radius: 50%;
    background: rgba(255, 107, 107, 0.1);
    border: none;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-btn:hover {
    transform: scale(1.2);
    color: #FF3B3B;
}

.item-edit-form {
    display: grid;
    gap: 15px;
    padding: 15px;
    height: 100%;
}

.edit-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.edit-btn, .save-btn, .cancel-btn {
    padding: 10px;
    border-radius: 50%;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-btn {
    background: rgba(255, 209, 102, 0.1);
    color: var(--accent);
}

.save-btn {
    background: rgba(6, 214, 160, 0.1);
    color: var(--accent2);
}

.cancel-btn {
    background: rgba(255, 107, 107, 0.1);
    color: var(--primary);
}

.item-actions {
    display: flex;
    gap: 10px;
}

@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .add-item-form, .graph-container, .items-list {
        padding: 20px;
    }
    
    .graph-header, .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .graph-container {
        display: none;
    }
    
    .mobile-message {
        display: block;
        text-align: center;
        padding: 20px;
        background: var(--card-bg);
        border-radius: 20px;
        margin: 20px 0;
    }
    
    .items-grid {
        grid-template-columns: 1fr;
    }

    .item {
        grid-template-columns: 1fr;
        grid-template-rows: auto 200px 1fr auto;
        height: auto;
        min-height: 450px;
        padding: 15px;
    }

    .item-header {
        grid-column: 1;
        grid-row: 1;
    }

    .item-image-wrapper {
        grid-column: 1;
        grid-row: 2;
    }

    .item-description {
        grid-column: 1;
        grid-row: 3;
    }

    .delete-btn {
        grid-column: 1;
        grid-row: 4;
    }
}

.items-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 20px;
    width: 100%;
    margin: 0 auto;
}

.admin-login-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--accent);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    padding: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    box-shadow: var(--shadow);
}

.admin-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 209, 102, 0.3);
}

.url-fetch-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 12px;
    background: var(--accent);
    border: none;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
}

.image-preview {
    margin-top: 10px;
    max-width: 200px;
    max-height: 200px;
    overflow: hidden;
    border-radius: 10px;
}

.image-preview img {
    width: 100%;
    height: auto;
}

.item-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--background);
}

.item-content.active {
    max-height: 500px;
    padding: 20px;
}

.item-details {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
}

.item-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
}

.item-url {
    color: var(--accent);
    text-decoration: none;
    margin-top: 10px;
    display: inline-block;
}

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

.items-list:hover, .add-item-form:hover, .item:hover {
    transform: none;
}

.footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    color: var(--text-light);
    font-size: 0.9rem;
    position: relative;
    bottom: 0;
    width: 100%;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.item-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
}

.item-meta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.item-url {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

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

.desire-stars {
    background: linear-gradient(to right, var(--accent) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-shadow: 0 0 2px rgba(255, 209, 102, 0.3);
}

.star-rating {
    display: inline-flex;
    align-items: center;
}

.stars {
    color: var(--accent);
    font-size: 1.1rem;
    letter-spacing: 2px;
    line-height: 1;
    background: linear-gradient(to right, #FFD166 0%, #FF6B6B 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 1px rgba(255, 209, 102, 0.1);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }

    .item {
        grid-template-columns: 200px 1fr;
        height: 280px;
        padding: 20px;
    }

    .item-name {
        font-size: 1.2rem;
    }

    .item-description {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 1.8rem;
    }
    
    .add-item-form {
        padding: 20px;
    }
    
    .items-list {
        padding: 15px;
    }

    .item {
        grid-template-columns: 1fr;
        grid-template-rows: auto 180px 1fr auto;
        height: auto;
        min-height: 400px;
    }

    .item-meta {
        flex-wrap: wrap;
        gap: 10px;
    }

    .fancy-input {
        padding: 12px 15px 12px 40px;
        font-size: 0.95rem;
    }

    .desire-slider {
        margin: 15px 0;
    }

    .admin-login-btn {
        position: fixed;
        top: auto;
        bottom: 20px;
        right: 20px;
        z-index: 100;
    }

    .modal-content {
        padding: 20px;
        width: 95%;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .fancy-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
        padding: 0 10px;
    }

    .container {
        padding: 10px;
    }

    .item {
        padding: 12px;
        min-height: 450px;
        gap: 15px;
    }

    .item-header {
        padding-bottom: 10px;
    }

    .item-name {
        font-size: 1.1rem;
    }

    .item-image-wrapper {
        height: 150px;
    }

    .fancy-button {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .list-header {
        gap: 10px;
    }

    .list-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .total-items {
        width: 100%;
        text-align: center;
        font-size: 0.9rem;
        padding: 10px;
    }

    .desire-stars {
        font-size: 1rem;
        letter-spacing: 1px;
    }

    .analysis-link {
        width: 100%;
        justify-content: center;
    }

    .stars {
        font-size: 0.9rem;
        letter-spacing: 1px;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .fancy-button:hover {
        transform: none;
    }

    .delete-btn {
        padding: 15px;
        width: 50px;
        height: 50px;
    }

    .styled-slider::-webkit-slider-thumb {
        width: 30px;
        height: 30px;
    }

    .item-meta a {
        padding: 8px 12px;
        margin: 5px 0;
    }
}

.filter-controls {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    background: #f8f8f8;
    padding: 15px;
    border-radius: 15px;
}

.search-box {
    position: relative;
    flex: 1;
}

.search-box .fancy-input {
    padding-right: 40px;
    background: white;
}

.fancy-select {
    min-width: 180px;
    padding: 12px 20px;
    border: 2px solid #E0E0E0;
    border-radius: 25px;
    background: white;
    color: var(--text);
    cursor: pointer;
    font-size: 0.95rem;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg fill='%23666' height='24' width='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 40px;
}

.fancy-select:focus {
    border-color: var(--primary);
    outline: none;
}

@media (max-width: 768px) {
    .filter-controls {
        flex-direction: column;
        padding: 10px;
    }

    .search-box, .fancy-select {
        width: 100%;
    }

    .fancy-select {
        min-width: 100%;
    }
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
}

.modal-content h2 {
    color: var(--primary);
    margin-bottom: 20px;
    text-align: center;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.modal-actions .fancy-button {
    flex: 1;
}

.fancy-button.secondary {
    background: var(--text-light);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: var(--accent2);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 214, 160, 0.3);
}

.share-link {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.share-link .fancy-input {
    flex: 1;
    padding-right: 20px;
    font-size: 0.9rem;
    background: #f8f8f8;
    cursor: text;
}

.share-link .fancy-button {
    width: auto;
    padding: 12px 20px;
    background: var(--accent2);
}

.share-link .fancy-button i {
    margin: 0;
}

@media (max-width: 768px) {
    .list-actions {
        width: 100%;
    }
    
    .share-btn {
        width: 100%;
        justify-content: center;
    }

    .share-link {
        flex-direction: column;
    }
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-tab.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    margin-bottom: -12px;
}

.auth-form {
    display: none;
    animation: fadeIn 0.3s ease;
}

.auth-form.active {
    display: block;
}

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