* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.5;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #222;
}

/* Input Section */
.input-section {
    margin-bottom: 25px;
}

#addForm {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#urlInput {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

#urlInput:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#addBtn {
    padding: 12px 24px;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

#addBtn:hover {
    background-color: #1d4ed8;
}

#addBtn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

.loading-message {
    font-size: 13px;
    color: #666;
    min-height: 20px;
}

.error {
    color: #dc2626;
}

.success {
    color: #059669;
}

/* Filter Section */
.filter-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background-color: white;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
}

.filter-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.filter-btn.active {
    background-color: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* Total Section */
.total-section {
    background-color: #f0f9ff;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #2563eb;
}

.total-price {
    font-size: 14px;
    color: #1e40af;
    font-weight: 600;
}

/* Items Container */
.items-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.empty-message {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 14px;
}

/* Item Card */
.item-card {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.item-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

.item-card.bought {
    opacity: 0.6;
    background-color: #f9fafb;
}

/* Item Image & Header */
.item-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.item-image {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    background-color: #f3f4f6;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-image.placeholder {
    background: linear-gradient(135deg, #e5e7eb 0%, #f3f4f6 100%);
}

.item-info-header {
    flex: 1;
    min-width: 0;
}

.item-title {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    margin-bottom: 3px;
    word-break: break-word;
    line-height: 1.3;
}

.item-domain {
    font-size: 12px;
    color: #999;
}

/* Item Description */
.item-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 26px;
}

/* Item Price & Brand */
.item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.item-price {
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
}

.item-brand {
    font-size: 12px;
    color: #999;
}

/* Item Actions */
.item-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background-color: #f3f4f6;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.action-btn:hover {
    background-color: #e5e7eb;
}

.action-btn.buy {
    background-color: #dbeafe;
    color: #1e40af;
}

.action-btn.buy:hover {
    background-color: #bfdbfe;
}

.action-btn.bought {
    background-color: #dcfce7;
    color: #15803d;
}

.action-btn.bought:hover {
    background-color: #bbf7d0;
}

.action-btn.delete {
    background-color: #fee2e2;
    color: #991b1b;
}

.action-btn.delete:hover {
    background-color: #fecaca;
}

.action-btn.open {
    background-color: #f3e8ff;
    color: #6b21a8;
}

.action-btn.open:hover {
    background-color: #e9d5ff;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    header h1 {
        font-size: 24px;
    }

    #addForm {
        flex-direction: column;
    }

    #urlInput,
    #addBtn {
        width: 100%;
    }

    .items-container {
        grid-template-columns: 1fr;
    }

    .filter-section {
        flex-wrap: wrap;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.item-card {
    animation: slideIn 0.3s ease-out;
}

/* Placeholder SVG */
svg.placeholder-icon {
    width: 40px;
    height: 40px;
    opacity: 0.3;
}
