/* TravelLog Modern Material Design Stylesheet */

/* Additional CSS for custom components and animations */
.sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapsed {
    transform: translateX(-100%);
}

/* Mobile sidebar toggle */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.sidebar-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}

/* Map SVG styling for modern look */
.country {
    fill: #404040;
    stroke: #666;
    stroke-width: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.country:hover {
    fill: #B8860B;
    stroke: #FFD700;
    stroke-width: 2;
}

.country.visited {
    fill: #FFD700;
    stroke: #B8860B;
    stroke-width: 2;
}

.country.visited:hover {
    fill: #B8860B;
    stroke: #FFD700;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #FFD700;
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #B8860B;
}

/* Enhanced card hover effects - optimized for performance */
.trip-card {
    will-change: transform;
    transition: transform 0.2s ease;
}

.trip-card:hover {
    transform: translateY(-4px);
}

.stat-card {
    will-change: transform;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

/* Smooth modal animations */
.modal {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Loading animation for buttons */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* Custom tooltip styles */
#country-tooltip {
    background: rgba(45, 45, 45, 0.95) !important;
    backdrop-filter: blur(8px);
    border: 1px solid #FFD700 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

/* Focus states for accessibility */
.nav-link:focus,
.openid-btn:focus,
button:focus {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

/* Material Design elevation shadows */
.elevation-1 {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.elevation-2 {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.1);
}

.elevation-3 {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.1);
}

/* Utility classes for consistent spacing */
.glass-effect {
    background: rgba(45, 45, 45, 0.9);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 215, 0, 0.2);
    will-change: transform;
    transform: translateZ(0);
}

/* Print styles */
@media print {
    .sidebar,
    #sidebarToggle,
    .modal {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}

/* Navigation Styles */
.navbar {
    background: linear-gradient(135deg, var(--secondary-black) 0%, var(--primary-black) 100%);
    border-bottom: 2px solid var(--primary-yellow);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow-dark);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo h1 {
    color: var(--primary-yellow);
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px var(--shadow-dark);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-white);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-link:hover {
    background-color: var(--accent-black);
    color: var(--primary-yellow);
}

/* User Dropdown Styles */
.user-dropdown {
    position: relative;
}

.user-btn {
    background: var(--accent-black);
    color: var(--text-white);
    border: 1px solid var(--primary-yellow);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.user-btn:hover {
    background-color: var(--primary-yellow);
    color: var(--primary-black);
}

.user-role {
    color: var(--primary-yellow);
    font-size: 0.9rem;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--secondary-black);
    min-width: 160px;
    box-shadow: 0 8px 16px var(--shadow-dark);
    border-radius: var(--border-radius);
    border: 1px solid var(--primary-yellow);
    z-index: 1;
}

.dropdown-content a {
    color: var(--text-white);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: var(--transition);
}

.dropdown-content a:hover {
    background-color: var(--primary-yellow);
    color: var(--primary-black);
}

.user-dropdown:hover .dropdown-content {
    display: block;
}

/* Dashboard Container */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    gap: 2rem;
    display: flex;
    flex-direction: column;
}

/* Stats Section */
.stats-section {
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--secondary-black) 0%, var(--accent-black) 100%);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 2px solid var(--primary-yellow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    box-shadow: 0 4px 8px var(--shadow-dark);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow-dark);
    border-color: var(--dark-yellow);
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--primary-yellow);
}

.stat-content h3 {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-number {
    color: var(--primary-yellow);
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
}

/* Map Section */
.map-section {
    background: var(--secondary-black);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 2px solid var(--primary-yellow);
    box-shadow: 0 4px 8px var(--shadow-dark);
}

.map-section h2 {
    color: var(--primary-yellow);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.8rem;
}

.map-container {
    width: 100%;
}

.world-map {
    width: 100%;
    height: 400px;
    background: var(--accent-black);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.map-svg {
    width: 100%;
    height: 100%;
}

.country {
    fill: var(--accent-black);
    stroke: var(--text-gray);
    stroke-width: 1;
    cursor: pointer;
    transition: var(--transition);
}

.country:hover {
    fill: var(--dark-yellow);
    stroke: var(--primary-yellow);
    stroke-width: 2;
}

.country.visited {
    fill: var(--primary-yellow);
    stroke: var(--dark-yellow);
    stroke-width: 2;
}

.country.visited:hover {
    fill: var(--dark-yellow);
    stroke: var(--primary-yellow);
}

/* Trips Section */
.trips-section {
    margin-top: 2rem;
}

.trips-section h2 {
    color: var(--primary-yellow);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.trips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.trip-card {
    background: var(--secondary-black);
    border-radius: var(--border-radius);
    border: 2px solid var(--primary-yellow);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 8px var(--shadow-dark);
}

.trip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow-dark);
    border-color: var(--dark-yellow);
}

.trip-image {
    height: 200px;
    background: var(--accent-black);
    display: flex;
    align-items: center;
    justify-content: center;
}

.trip-placeholder {
    font-size: 3rem;
    color: var(--primary-yellow);
}

.trip-content {
    padding: 1.5rem;
}

.trip-content h3 {
    color: var(--primary-yellow);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.trip-date {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.trip-description {
    color: var(--text-white);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.trip-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: var(--primary-yellow);
    color: var(--primary-black);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, var(--secondary-black) 0%, var(--primary-black) 100%);
    margin: 5% auto;
    padding: 0;
    border: 3px solid var(--primary-yellow);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px var(--shadow-dark);
}

.modal-header {
    background: var(--primary-yellow);
    color: var(--primary-black);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close {
    color: var(--primary-black);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--secondary-black);
}

.modal-body {
    padding: 2rem;
}

/* Auth Styles */
.auth-container {
    width: 100%;
}

.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--accent-black);
}

.auth-tab {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}

.auth-tab.active {
    color: var(--primary-yellow);
    border-bottom-color: var(--primary-yellow);
}

.auth-tab:hover {
    color: var(--primary-yellow);
}

.auth-form {
    text-align: center;
}

.auth-form.hidden {
    display: none;
}

.auth-form h3 {
    color: var(--primary-yellow);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.auth-form p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
}

.openid-btn {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--accent-black);
    color: var(--text-white);
    border: 2px solid var(--primary-yellow);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: var(--transition);
}

.openid-btn:hover {
    background: var(--primary-yellow);
    color: var(--primary-black);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-dark);
}

.openid-icon {
    font-weight: bold;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .dashboard-container {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .trips-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .nav-logo h1 {
        font-size: 1.5rem;
    }
    
    .map-section,
    .dashboard-container {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
}