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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #B0E0E6 50%, #E0F6FF 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #2c3e50;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    box-shadow: 0 25px 80px rgba(135, 206, 235, 0.3);
    width: 100%;
    max-width: 1200px;
    padding: 40px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid rgba(135, 206, 235, 0.3);
}

h1 {
    color: #2c3e50;
    font-size: 3.5em;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(135, 206, 235, 0.3);
    background: linear-gradient(135deg, #2c3e50, #3498db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #5a6c7d;
    font-size: 1.2em;
    font-weight: 300;
    margin-bottom: 20px;
}

.share-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.share-btn, .copy-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    font-family: inherit;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.share-btn:hover, .copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.share-link {
    display: flex;
    gap: 10px;
    align-items: center;
}

.share-link.hidden {
    display: none;
}

#linkInput {
    padding: 10px 15px;
    border: 2px solid #bdc3c7;
    border-radius: 20px;
    font-size: 14px;
    min-width: 200px;
    background: white;
}

/* Main Content */
main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

/* Shopping Section */
.shopping-section {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(135, 206, 235, 0.2);
    border: 1px solid rgba(135, 206, 235, 0.3);
}

.shopping-section h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.8em;
    text-align: center;
    font-weight: 600;
}

.add-item-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr auto;
    gap: 15px;
    margin-bottom: 25px;
    align-items: center;
}

.add-item-form input, .add-item-form select {
    padding: 15px 18px;
    border: 2px solid #e8f4f8;
    border-radius: 15px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    color: #2c3e50;
}

.add-item-form input:focus, .add-item-form select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.unit-select {
    background: white;
    cursor: pointer;
}

.add-btn {
    padding: 15px 25px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    font-family: inherit;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* Total Section */
.total-section {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
}

.total-section.hidden {
    display: none;
}

.total-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-label {
    font-size: 1.2em;
    font-weight: 600;
}

.total-amount {
    font-size: 1.5em;
    font-weight: 700;
}

/* Items List */
.items-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.items-list::-webkit-scrollbar {
    width: 8px;
}

.items-list::-webkit-scrollbar-track {
    background: #f1f8ff;
    border-radius: 10px;
}

.items-list::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 10px;
}

.item {
    background: white;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(135, 206, 235, 0.1);
    border: 1px solid rgba(135, 206, 235, 0.2);
    animation: slideIn 0.3s ease;
}

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

.item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(135, 206, 235, 0.2);
}

.item.completed {
    opacity: 0.6;
    background: #f8f9fa;
}

.item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #3498db;
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.item-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.item.completed .item-name {
    text-decoration: line-through;
    color: #7f8c8d;
}

.item-quantity {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 500;
}

.item-price {
    font-weight: 700;
    color: #27ae60;
    font-size: 16px;
    min-width: 100px;
    text-align: right;
}

.item.completed .item-price {
    color: #95a5a6;
}

.delete-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.3);
    font-family: inherit;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.delete-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    border: 2px dashed #bdc3c7;
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 10px;
}

.empty-hint {
    font-size: 14px;
    color: #95a5a6;
}

/* Love Message Section */
.love-message {
    grid-column: 1 / -1;
    margin-top: 20px;
}

.love-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(135, 206, 235, 0.2);
    border: 1px solid rgba(135, 206, 235, 0.3);
    position: relative;
    overflow: hidden;
}

.love-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2980b9, #3498db);
}

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

.card-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.heart-icon {
    font-size: 2em;
    margin: 0 20px;
    animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.decorative-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, #3498db, transparent);
}

.love-title {
    color: #2c3e50;
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-subtitle {
    color: #7f8c8d;
    font-size: 1em;
    font-style: italic;
    font-weight: 300;
}

.card-body {
    margin-bottom: 30px;
}

.message-input-section {
    margin-bottom: 30px;
}

.typing-indicator {
    background: rgba(52, 152, 219, 0.1);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    display: none;
}

.typing-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.typing-text {
    color: #3498db;
    font-size: 14px;
    font-weight: 500;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #3498db;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.letter-paper {
    position: relative;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(135, 206, 235, 0.15);
    border: 1px solid rgba(135, 206, 235, 0.2);
    margin-bottom: 20px;
}

.paper-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(
        transparent,
        transparent 31px,
        rgba(135, 206, 235, 0.1) 31px,
        rgba(135, 206, 235, 0.1) 32px
    );
    pointer-events: none;
    border-radius: 15px;
}

#loveMessageInput {
    width: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    line-height: 1.6;
    color: #2c3e50;
    background: transparent;
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

#loveMessageInput::placeholder {
    color: #bdc3c7;
    font-style: italic;
}

.message-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.send-message-btn {
    padding: 15px 40px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    font-family: inherit;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.send-message-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.btn-icon {
    font-size: 1.2em;
}

.draft-status {
    text-align: center;
    font-size: 14px;
    color: #27ae60;
    font-weight: 500;
}

.messages-list {
    max-height: 300px;
    overflow-y: auto;
}

.messages-list::-webkit-scrollbar {
    width: 6px;
}

.messages-list::-webkit-scrollbar-track {
    background: #f1f8ff;
    border-radius: 10px;
}

.messages-list::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 10px;
}

/* Message Items */
.message-item {
    background: white;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(135, 206, 235, 0.1);
    border: 1px solid rgba(135, 206, 235, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

.message-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(135, 206, 235, 0.2);
}

.message-content {
    flex: 1;
}

.message-text {
    font-size: 16px;
    line-height: 1.6;
    color: #2c3e50;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.message-date {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 500;
}

.delete-message-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.3);
    flex-shrink: 0;
    font-family: inherit;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.delete-message-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.empty-messages {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    border: 2px dashed #bdc3c7;
}

.empty-messages p {
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-messages .empty-hint {
    font-size: 14px;
    color: #95a5a6;
}

.card-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(135, 206, 235, 0.3);
}

.decorative-pattern {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: #bdc3c7;
    font-size: 1.5em;
}

/* Responsive Design */
@media (max-width: 1024px) {
    main {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .container {
        max-width: 800px;
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    h1 {
        font-size: 2.5em;
    }
    
    .add-item-form {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .add-item-form input, .add-item-form select {
        width: 100%;
    }
    
    .love-card {
        padding: 25px;
    }
    
    .send-message-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .love-title {
        font-size: 1.8em;
    }
    
    .shopping-section {
        padding: 20px;
    }
    
    .love-card {
        padding: 20px;
    }
}