:root {
    --primary-color: #4285f4;
    --secondary-color: #34a853;
    --accent-color: #ea4335;
    --dark-color: #003366;
    --light-color: #f8f9fa;
    --text-color: #333;
    --text-light: #666;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: var(--text-color);
    line-height: 1.6;
}

nav {
    background-color: var(--dark-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.nav-links {
    display: flex;
    flex: 1;
    justify-content: flex-end;
}

.nav-links #loginLink,
.nav-links #logoutLink {
    margin-left: auto;
}

nav a {
    display: flex;
    align-items: center;
    color: white;
    text-align: center;
    padding: 18px 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

nav a.active {
    background-color: var(--primary-color);
    font-weight: 500;
}

nav a.active:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background-color: white;
}

nav a i {
    margin-right: 8px;
    font-size: 0.9em;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
}

.header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 30px;
    margin-bottom: 40px;
    text-align: center;
    width: 100%;
    max-width: 600px;
}

.profile-img {
    width: 200px;
    height: auto;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 5px solid var(--light-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.profile-bio {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
}

.profile-info {
    width: 100%;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.info-label {
    margin-right: 10px;
    min-width: 100px;
    text-align: right;
}

.profile-name, .profile-email, #number_of_links {
    text-align: left;
    margin: 0;
    color: var(--dark-color);
}

.visitor-info {
    margin: 20px 0;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.social-link {
    color: var(--primary-color);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.social-link:hover {
    color: var(--dark-color);
    transform: translateY(-3px);
}

.contact-info {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 30px;
    margin-bottom: 40px;
    width: 100%;
    max-width: 600px;
}

.contact-info h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--dark-color);
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.contact-icon {
    width: 40px;
    height: 40px;
    background-color: var(--light-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--primary-color);
}

.contact-text {
    flex: 1;
}

.contact-text a {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-text a:hover {
    text-decoration: underline;
}

.logout-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.logout-btn:active {
    transform: translateY(0);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.alert-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    text-align: center;
    max-width: 400px;
    width: 90%;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.alert-box.show {
    opacity: 1;
    visibility: visible;
}

.alert-box p {
    margin-bottom: 20px;
    font-size: 1rem;
    color: var(--text-color);
}

.alert-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.alert-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    text-align: center;
    box-sizing: border-box;
}

.alert-btn.confirm-btn {
    background-color: var(--primary-color);
    color: white;
}

.alert-btn.confirm-btn:hover {
    opacity: 0.9;
}

.alert-btn.cancel-btn {
    background-color: #f0f0f0;
    color: var(--text-color);
}

.alert-btn.cancel-btn:hover {
    opacity: 0.9;
}

.alert-message {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 5px;
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.alert-message.show {
    opacity: 1;
    visibility: visible;
}

.alert-message.success {
    background-color: var(--secondary-color);
}

.alert-message.error {
    background-color: var(--accent-color);
}

.alert-message.info {
    background-color: var(--primary-color);
}

footer {
    background-color: var(--dark-color);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 50px;
}

#usernameHeader {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.profile-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.edit-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.edit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.edit-btn:active {
    transform: translateY(0);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.edit-modal.active {
    opacity: 1;
    visibility: visible;
}

.edit-modal-content {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.edit-modal-header {
    margin-bottom: 20px;
    text-align: center;
    color: var(--dark-color);
}

.edit-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.edit-form-group {
    margin-bottom: 20px;
    position: relative;
}

.edit-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.edit-form-group input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.edit-form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.edit-form-group input.invalid {
    border-color: var(--accent-color);
}

.edit-form-group input[type="file"] {
    padding: 10px 0;
    border: none;
}

.edit-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
}

.edit-modal-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.edit-modal-actions .cancel-btn {
    background-color: #f0f0f0;
    color: var(--text-color);
}

.edit-modal-actions .save-btn {
    background-color: var(--primary-color);
    color: white;
}

.edit-modal-actions button:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-2px);
}

.edit-modal-actions button:active {
    transform: translateY(0);
}

.image-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 10px auto;
    display: block;
    border: 3px solid var(--light-color);
}

.error-message {
    color: var(--accent-color);
    font-size: 0.85rem;
    margin-top: 5px;
    height: 20px;
    display: block;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.password-prompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.prompt-content {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: fade-in 0.3s ease;
}

.prompt-content h3 {
    margin-bottom: 20px;
    color: var(--text-color);
}

.password-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.prompt-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.prompt-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.confirm-btn {
    background-color: var(--primary-color);
    color: white;
}

.cancel-btn {
    background-color: #f0f0f0;
    color: var(--text-color);
}

.prompt-buttons button:hover {
    opacity: 0.9;
}

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

@media (max-width: 768px) {
    .profile-actions {
        flex-direction: column;
    }
    
    .edit-btn, .logout-btn {
        width: 100%;
    }
    
    .edit-modal-content {
        padding: 20px;
    }
    
    .edit-modal-actions {
        justify-content: center;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        justify-content: flex-start;
    }

    .nav-links #loginLink,
    .nav-links #logoutLink {
        margin-left: 0;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    nav a {
        padding: 12px;
        justify-content: center;
    }
    
    .nav-container {
        flex-direction: column;
        padding: 0px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .profile-card, .contact-info {
        padding: 20px;
    }

    .profile-img {
        width: 120px;
        height: 120px;
    }
    
    .info-row {
        flex-direction: column;
        align-items: center;
        margin-bottom: 15px;
    }
    
    .info-label {
        min-width: unset;
        margin-right: 0;
        text-align: center;
        margin-bottom: 5px;
    }
    
    .profile-name, .profile-email, #number_of_links {
        text-align: center;
    }
    
    .visitor-info {
        margin: 15px 0;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 30px 15px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .profile-name {
        font-size: 1.5rem;
    }
    
    .alert-box {
        max-width: 90%;
    }
    
    .profile-card {
        padding: 15px;
    }
    
    .info-label {
        font-size: 1.1rem;
    }
    
    .profile-name, .profile-email, #number_of_links {
        font-size: 1rem;
    }
}