* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Steps */
.step {
    display: none;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    animation: fadeInUp 0.6s ease-out;
}

.step.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #4a5568;
    font-size: 1.8rem;
}

/* Form Styles */
.form {
    max-width: 400px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(240, 147, 251, 0.3);
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 1.5em;
}

.category-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.category-card.selected::before {
    opacity: 1;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.category-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-5px);
}

.category-card i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.category-card span {
    font-weight: 600;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Swiping Interface */
.swiping-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.progress-indicator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.gift-card-container {
    position: relative;
    margin-bottom: 30px;
}

.gift-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.gift-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.gift-image {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.gift-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    background-color: #f8f9fa;
}

.gift-image img[src=""] {
    opacity: 0;
}

.gift-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gift-card:hover .gift-overlay {
    opacity: 1;
}

.link-btn {
    background: rgba(255,255,255,0.9);
    color: #667eea;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.link-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.gift-info {
    padding: 25px;
}

.gift-info h3 {
    margin-bottom: 10px;
    color: #2d3748;
    font-size: 1.3rem;
}

.gift-info p {
    color: #718096;
    margin-bottom: 15px;
    line-height: 1.6;
}

.gift-price {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

/* Swipe Buttons */
.swipe-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.btn-dislike {
    background: #e53e3e;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
}

.btn-dislike:hover {
    background: #c53030;
    transform: scale(1.1);
}

.btn-like {
    background: #38a169;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
}

.btn-like:hover {
    background: #2f855a;
    transform: scale(1.1);
}

/* Liked Gifts */
.liked-gifts {
    margin-top: 40px;
}

.liked-gifts h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #4a5568;
}

.liked-gifts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.liked-gift-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
    position: relative;
}

.liked-gift-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.liked-gift-item:hover::before {
    opacity: 0.1;
}

.liked-gift-item:hover {
    transform: translateY(-5px);
}

.liked-gift-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.liked-gift-item .gift-info {
    padding: 15px;
    position: relative;
    z-index: 2;
}

.liked-gift-item h4 {
    font-size: 1rem;
    margin-bottom: 5px;
    color: #2d3748;
}

.liked-gift-item .price {
    color: #667eea;
    font-weight: 600;
}

/* End Message */
.end-message {
    text-align: center;
    padding: 40px 20px;
}

.end-message h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 2rem;
}

.end-message p {
    color: #718096;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .step {
        padding: 25px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }
    
    .swiping-header {
        flex-direction: column;
        text-align: center;
    }
    
    .gift-image {
        height: 250px;
    }
    
    .swipe-buttons {
        gap: 15px;
    }
    
    .btn-dislike,
    .btn-like {
        width: 50px;
        height: 50px;
    }

    .end-message h2 {
        font-size: 1.5rem;
    }
    
    .end-message p {
        font-size: 1rem;
    }
    
    .progress-indicator {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .step {
        padding: 20px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .gift-image {
        height: 200px;
    }

    .end-message {
        padding: 30px 15px;
    }
    
    .end-message h2 {
        font-size: 1.3rem;
    }
}

#categoryStep p {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

/* Category selection styling */
.category-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.category-header h2 {
    margin: 0;
    flex: 1;
}

#backToUserInfo {
    flex-shrink: 0;
}

.categories-grid {
    margin-bottom: 1.5em;
}

.gift-description {
    margin: 10px 0;
    line-height: 1.4;
    color: #666;
    min-height: 60px; /* Fixed minimum height to prevent jumping */
    display: flex;
    flex-direction: column;
}

.gift-description .read-more:hover {
    text-decoration: underline;
}
