/* ==================== Global Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(to bottom, #87CEEB 0%, #4A90E2 50%, #2E5F8F 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

/* ==================== Header ==================== */
.header {
    background: linear-gradient(135deg, rgba(30, 87, 153, 0.9), rgba(32, 124, 229, 0.9));
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.title {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

/* ==================== Main Container ==================== */
.main-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* ==================== Action Bar ==================== */
.action-bar {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.bottle-counter {
    background: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    color: #2E5F8F;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==================== Buttons ==================== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
}

.btn-secondary {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #F57C00, #E65100);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-back {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==================== Ocean Section ==================== */
.ocean-section {
    position: relative;
    min-height: 500px;
}

.ocean-container {
    position: relative;
    background: linear-gradient(to bottom, 
        rgba(135, 206, 235, 0.3) 0%,
        rgba(74, 144, 226, 0.5) 50%,
        rgba(46, 95, 143, 0.7) 100%
    );
    border-radius: 20px;
    padding: 2rem;
    min-height: 500px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.ocean {
    position: relative;
    min-height: 400px;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.empty-ocean {
    text-align: center;
    padding: 4rem 2rem;
    color: white;
    font-size: 1.2rem;
}

.empty-ocean p {
    margin: 1rem 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

/* ==================== Bottles ==================== */
.bottle {
    position: relative;
    width: 60px;
    height: 80px;
    cursor: pointer;
    transition: transform 0.3s ease;
    animation: float 6s ease-in-out infinite;
}

.bottle:hover {
    transform: scale(1.2) rotate(5deg);
}

.bottle:hover .bottle-tooltip {
    opacity: 1;
    visibility: visible;
}

.bottle-icon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.bottle-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
    z-index: 10;
}

.bottle-floating {
    animation: float 6s ease-in-out infinite, drift 20s linear infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

@keyframes drift {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(10px);
    }
    100% {
        transform: translateX(0);
    }
}

/* ==================== Waves ==================== */
.waves {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    z-index: 1;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 100"><path d="M0,50 Q300,0 600,50 T1200,50 L1200,100 L0,100 Z" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: 50% 100%;
    animation: wave 10s linear infinite;
}

.wave2 {
    animation: wave 15s linear infinite;
    opacity: 0.5;
}

.wave3 {
    animation: wave 20s linear infinite;
    opacity: 0.3;
}

@keyframes wave {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* ==================== Form Section ==================== */
.form-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    margin: 0 auto;
}

.form-container h2 {
    color: #2E5F8F;
    margin-bottom: 0.5rem;
}

.form-description {
    color: #666;
    margin-bottom: 2rem;
}

.message-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #2E5F8F;
}

.form-group textarea,
.form-group input {
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group textarea:focus,
.form-group input:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.char-counter-container {
    text-align: right;
}

.char-counter {
    font-size: 0.875rem;
    color: #666;
}

.form-error {
    background: #ffebee;
    color: #c62828;
    padding: 0.75rem;
    border-radius: 8px;
    border-left: 4px solid #c62828;
}

/* ==================== Modal ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.bottle-opened {
    text-align: center;
    margin-bottom: 2rem;
}

.bottle-animation {
    font-size: 4rem;
    animation: bottlePop 0.6s ease-out;
}

@keyframes bottlePop {
    0% {
        transform: scale(0) rotate(0deg);
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.bottle-opened h2 {
    color: #2E5F8F;
    margin-top: 1rem;
}

.message-content {
    background: #f5f5f5;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.message-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #333;
    font-style: italic;
}

.message-metadata {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.metadata-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.metadata-label {
    font-weight: 600;
    color: #666;
}

.metadata-value {
    color: #333;
}

.modal-actions {
    text-align: center;
}

/* ==================== Notifications ==================== */
.notification {
    position: fixed;
    top: 20px;
    right: -300px;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    transition: right 0.3s ease;
    min-width: 250px;
}

.notification.show {
    right: 20px;
}

.notification-success {
    border-left: 4px solid #4CAF50;
}

.notification-error {
    border-left: 4px solid #f44336;
}

.notification-info {
    border-left: 4px solid #2196F3;
}

/* ==================== Footer ==================== */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 3rem;
}

.footer p {
    margin: 0.5rem 0;
}

.footer-note {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .action-bar {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .ocean-container {
        padding: 1rem;
        min-height: 400px;
    }
    
    .bottle {
        width: 50px;
        height: 70px;
    }
    
    .form-section {
        padding: 1rem;
    }
    
    .modal {
        width: 95%;
        padding: 1.5rem;
    }
}