* {
    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, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
}

#app {
    height: 100vh;
    position: relative;
}

/* Swipe Container */
.swipe-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.header {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.header-dolphin-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Card Stack */
.card-stack {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.dolphin-card {
    position: absolute;
    width: 95%;
    max-width: 500px;
    height: 70vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow: hidden;
    cursor: grab;
    transition: transform 0.3s ease;
    user-select: none;
}

.dolphin-card:active {
    cursor: grabbing;
}

.dolphin-card.dragging {
    transition: none;
}

.dolphin-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    transform: scale(1.05);
}

.dolphin-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 30px 20px 20px;
}

.dolphin-name {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.dolphin-age {
    font-size: 1.2rem;
    opacity: 0.9;
}

.dolphin-bio {
    font-size: 1rem;
    margin-top: 10px;
    line-height: 1.4;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 30px;
}

.action-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.pass-btn {
    background: #ff4757;
    color: white;
}

.pass-btn:hover {
    transform: scale(1.1);
    background: #ff3742;
}

.like-btn {
    background: #2ed573;
    color: white;
}

.like-btn:hover {
    transform: scale(1.1);
    background: #26d067;
}

/* Match Screen */
.match-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.match-content {
    text-align: center;
    color: white;
    padding: 40px;
}

.match-content h2 {
    font-size: 3rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.match-dolphin img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 5px solid white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.match-dolphin h3 {
    font-size: 1.5rem;
    margin-bottom: 30px;
}

.start-chat-btn {
    background: #2ed573;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.start-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* Chat Interface */
.chat-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}

.chat-header {
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 15px;
}

.back-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #667eea;
    padding: 5px;
}

.back-btn:hover {
    background: #f8f9fa;
    border-radius: 5px;
}

.chat-header h3 {
    color: #333;
    font-size: 1.2rem;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 80%;
}

.dolphin-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 30%;
    flex-shrink: 0;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.dolphin-message .message-content {
    background: #e3f2fd;
}

.user-message .message-content {
    background: #667eea;
    color: white;
}

.message-content p {
    margin: 0;
    line-height: 1.4;
}

/* Audio Message Styling */
.audio-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f0f8ff;
    border: 2px solid #e3f2fd;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.audio-message:hover {
    background: #e3f2fd;
    border-color: #bbdefb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.audio-message:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.audio-icon {
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

.audio-text {
    font-weight: 500;
    color: #1976d2;
    font-size: 0.95rem;
}

.dolphin-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

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

.chat-input-container {
    background: white;
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    align-items: center;
}

#message-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 12px 16px;
    font-size: 1rem;
    outline: none;
}

#message-input:focus {
    border-color: #667eea;
}

#send-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

#send-btn:hover {
    background: #5a6fd8;
}

/* End Screen */
.end-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.end-content {
    text-align: center;
    color: white;
    padding: 40px;
}

.end-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.end-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.restart-btn {
    background: #2ed573;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes slideOutLeft {
    to {
        transform: translateX(-100vw) rotate(-30deg);
        opacity: 0;
    }
}

@keyframes slideOutRight {
    to {
        transform: translateX(100vw) rotate(30deg);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.slide-out-left {
    animation: slideOutLeft 0.3s ease-in forwards;
}

.slide-out-right {
    animation: slideOutRight 0.3s ease-in forwards;
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dolphin-card {
        width: 95%;
        height: 65vh;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .action-btn {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .match-content h2 {
        font-size: 2.5rem;
    }
    
    .match-dolphin img {
        width: 150px;
        height: 150px;
    }
}
