/**
 * Voyage Custom Styles
 * Supplements Bootstrap 5
 * Enhanced for Sea Trade and Adventure Game
 */

:root {
    --ocean-dark: #1a2980;
    --ocean-light: #26d0ce;
    --ship-wood: #8B4513;
    --gold-coin: #FFD700;
    --bg-dark: #0d1b2a;
    --bg-medium: #1b263b;
    --bg-light: #415a77;
    --bg-card: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --border-subtle: rgba(255, 255, 255, 0.15);
}

/* Background utilities */
.bg-ocean {
    background: linear-gradient(135deg, var(--ocean-dark) 0%, var(--ocean-light) 100%);
}

.bg-dark-blue {
    background: var(--bg-dark);
}

.bg-ship-wood {
    background: linear-gradient(135deg, var(--ship-wood) 0%, #654321 100%);
}

.bg-medium {
    background: var(--bg-medium);
}

/* Text utilities */
.text-gold {
    color: var(--gold-coin) !important;
}

.text-ship-wood {
    color: var(--ship-wood) !important;
}

.text-ocean-light {
    color: var(--ocean-light) !important;
}

/* Card styling */
.card-voyage {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card-voyage-dark {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
}

/* Button styles */
.btn-voyage {
    background: linear-gradient(135deg, var(--ocean-dark) 0%, var(--ocean-light) 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-voyage:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 208, 206, 0.4);
    color: white;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold-coin) 0%, #FFA500 100%);
    border: none;
    color: #1a1a1a;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.5);
    color: #1a1a1a;
}

.btn-wood {
    background: linear-gradient(135deg, var(--ship-wood) 0%, #654321 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-wood:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.5);
    color: white;
}

/* Connection status dot */
.connection-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.connection-dot.online {
    background: #198754;
    box-shadow: 0 0 5px #198754;
}

.connection-dot.offline {
    background: #dc3545;
    box-shadow: 0 0 5px #dc3545;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Price colors */
.text-success {
    color: #198754 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

/* Navigation */
.navbar-voyage {
    background: linear-gradient(135deg, var(--ship-wood) 0%, #654321 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.navbar-voyage .navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--gold-coin) !important;
}

.navbar-voyage .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    transition: all 0.3s;
    font-weight: 500;
}

.navbar-voyage .nav-link:hover,
.navbar-voyage .nav-link.active {
    color: var(--gold-coin) !important;
}

/* Tab styling */
.nav-tabs-voyage {
    border-bottom: 2px solid var(--border-subtle);
}

.nav-tabs-voyage .nav-link {
    color: var(--text-secondary);
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 20px;
    font-weight: 500;
    transition: all 0.3s;
}

.nav-tabs-voyage .nav-link:hover {
    color: var(--text-primary);
    border-color: var(--ocean-light);
}

.nav-tabs-voyage .nav-link.active {
    color: var(--gold-coin) !important;
    background: transparent;
    border-bottom-color: var(--gold-coin);
}

/* Form styling */
.form-control-voyage {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.3s;
}

.form-control-voyage:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--ocean-light);
    box-shadow: 0 0 0 3px rgba(38, 208, 206, 0.2);
    color: var(--text-primary);
}

.form-control-voyage::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-label-voyage {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

/* Table styling */
.table-voyage {
    color: var(--text-primary);
}

.table-voyage thead th {
    background: var(--bg-medium);
    border-bottom: 2px solid var(--ocean-light);
    color: var(--ocean-light);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 12px 16px;
}

.table-voyage tbody td {
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 16px;
    vertical-align: middle;
}

.table-voyage tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Badge styles */
.badge-voyage {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
}

.badge-gold {
    background: linear-gradient(135deg, var(--gold-coin) 0%, #FFA500 100%);
    color: #1a1a1a;
}

.badge-ocean {
    background: linear-gradient(135deg, var(--ocean-dark) 0%, var(--ocean-light) 100%);
    color: white;
}

.badge-wood {
    background: linear-gradient(135deg, var(--ship-wood) 0%, #654321 100%);
    color: white;
}

/* Progress bar */
.progress-voyage {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-bar-voyage {
    background: linear-gradient(135deg, var(--ocean-dark) 0%, var(--ocean-light) 100%);
    border-radius: 10px;
}

.progress-bar-gold {
    background: linear-gradient(135deg, var(--gold-coin) 0%, #FFA500 100%);
    border-radius: 10px;
}

/* Alert styles */
.alert-voyage {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text-primary);
}

.alert-voyage.info {
    border-left: 4px solid var(--ocean-light);
}

.alert-voyage.success {
    border-left: 4px solid #198754;
}

.alert-voyage.warning {
    border-left: 4px solid #ffc107;
}

.alert-voyage.danger {
    border-left: 4px solid #dc3545;
}

/* Modal styling */
.modal-voyage .modal-content {
    background: var(--bg-medium);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
}

.modal-voyage .modal-header {
    border-bottom: 1px solid var(--border-subtle);
}

.modal-voyage .modal-footer {
    border-top: 1px solid var(--border-subtle);
}

/* Loading spinner */
.spinner-voyage {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--ocean-light);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility classes */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
}

.border-gold {
    border-color: var(--gold-coin) !important;
}

.border-ocean {
    border-color: var(--ocean-light) !important;
}

/* Stat display */
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold-coin);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Resource bar */
.resource-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.resource-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .btn-voyage, .btn-gold, .btn-wood {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .card-voyage {
        border-radius: 12px;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
}

/* ============================================
   Bottom Navigation (Mobile)
   ============================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(13, 27, 42, 0.95) 0%, rgba(13, 27, 42, 0.98) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-subtle);
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 1050;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.bottom-nav .row {
    margin: 0;
}

.bottom-nav .col {
    padding: 0;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 0 4px;
    min-height: 50px;
}

.bottom-nav-item i {
    font-size: 1.2rem;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
}

.bottom-nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}

.bottom-nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.bottom-nav-item:active i {
    transform: scale(1.15);
}

.bottom-nav-item.active {
    color: var(--gold-coin) !important;
    background: rgba(255, 215, 0, 0.12);
}

.bottom-nav-item.active i {
    transform: scale(1.1);
}

/* Bottom nav spacing - add padding to body/content to prevent overlap */
@media (max-width: 991.98px) {
    body {
        padding-bottom: 70px;
    }
    
    .main-content {
        padding-bottom: 80px;
    }
}
