:root {
    /* Main colors */
    --primary-color: #009bff;
    --text-color: #333;
    --bg-color: #fff;
    --secondary-bg: #f5f5f5;
    --border-color: #ddd;
    --button-text: #fff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    
    /* Button colors */
    --email-color: #ea4335;
    --zalo-color: #0068ff;
    --facebook-color: #1877f2;
    --group-color: #4267B2;
    
    /* Transition for theme toggle */
    --transition: all 0.3s ease;
}

/* Dark theme variables */
[data-theme="dark"] {
    --primary-color: #00a8ff;
    --text-color: #f5f5f5;
    --bg-color: #121212;
    --secondary-bg: #1e1e1e;
    --border-color: #333;
    --shadow-color: rgba(0, 0, 0, 0.3);
    
    /* Button colors in dark mode */
    --email-color: #ff5a5a;
    --zalo-color: #3b8aff;
    --facebook-color: #4080ff;
    --group-color: #5d7ec9;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 800px;
    width: 100%;
    margin: 20px auto; /* Added margin for better centering on large screens */
    padding: 0;
    box-shadow: 0 5px 15px var(--shadow-color);
    border-radius: 10px;
    overflow: hidden;
    background-color: var(--bg-color);
    transition: background-color 0.3s ease;
}

/* Cover Image */
.cover-image {
    width: 100%;
    height: 180px; /* Reduced height */
    background-image: url('images/cover-ga4-2025web.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Profile Section */
.profile-section {
    display: flex;
    align-items: center;
    padding: 15px 20px; /* Adjusted padding */
    position: relative;
}

.avatar {
    width: 110px; /* Slightly reduced size */
    height: 110px;
    border-radius: 50%;
    border: 4px solid var(--bg-color);
    background-image: url('images/avt-toan2025.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin-top: -55px; /* Adjusted for new size */
    box-shadow: 0 5px 15px var(--shadow-color);
    flex-shrink: 0;
}

.profile-info {
    margin-left: 20px;
    flex: 1;
}

.name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-color);
}

.nickname {
    font-size: 16px;
    color: var(--primary-color);
    margin-bottom: 5px; /* Reduced margin */
}

.bio {
    font-size: 14px;
    color: var(--text-color);
    opacity: 0.9;
    line-height: 1.4; /* Tighter line height */
    margin-top: 8px; /* Added slight margin top */
}

/* Contact Buttons - Redesigned for professional appearance */
.contact-buttons {
    display: flex;
    justify-content: center;
    padding: 15px 20px; /* Consistent padding */
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px var(--shadow-color);
    position: relative;
    overflow: hidden;
    z-index: 1;
    min-width: 0;
    flex: 0 1 auto;
    color: var(--button-text);
    border: none;
    background-size: 200% auto;
    background-position: left center;
}

/* Gradient effect for buttons */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    z-index: -1;
    transform: scale(0);
    transition: transform 0.3s ease;
    border-radius: 8px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px var(--shadow-color);
    background-position: right center;
}

.btn:hover::before {
    transform: scale(1);
}

.btn:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px var(--shadow-color);
}

.btn i {
    margin-right: 8px;
    font-size: 15px;
}

/* Email button with gradient */
.email-btn {
    background-image: linear-gradient(to right, var(--email-color) 0%, #ff7043 51%, var(--email-color) 100%);
    max-width: 120px;
}

/* Zalo button with gradient */
.zalo-btn {
    background-image: linear-gradient(to right, var(--zalo-color) 0%, #00c6ff 51%, var(--zalo-color) 100%);
    max-width: 120px;
}

/* Facebook button with gradient */
.facebook-btn {
    background-image: linear-gradient(to right, var(--facebook-color) 0%, #45aaf2 51%, var(--facebook-color) 100%);
    max-width: 120px;
}

/* Facebook Group button with gradient */
.facebook-group-btn {
    background-image: linear-gradient(to right, var(--group-color) 0%, #7986cb 51%, var(--group-color) 100%);
    max-width: 120px;
}

/* Social Links */
.social-links {
    padding: 15px 20px; /* Consistent padding */
    background-color: var(--secondary-bg);
    transition: background-color 0.3s ease;
}

.social-links h2 {
    font-size: 18px;
    margin-bottom: 12px; /* Reduced margin */
    text-align: center;
}

.social-icons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr)); /* Adjusted minmax */
    gap: 15px;
    justify-content: center;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px; /* Slightly reduced size */
    height: 48px;
    border-radius: 50%;
    background-color: var(--bg-color);
    color: var(--primary-color);
    font-size: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease;
    text-decoration: none;
    box-shadow: 0 3px 10px var(--shadow-color);
    margin: 0 auto;
}

.social-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow-color);
    background-color: var(--primary-color);
    color: white;
}

/* Skills Section */
.skills-section {
    padding: 15px 20px; /* Consistent padding */
}

.skills-section h2 {
    font-size: 18px;
    margin-bottom: 12px; /* Reduced margin */
    text-align: center;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px; /* Reduced gap */
}

.skill {
    margin-bottom: 12px; /* Reduced margin */
}

.skill-name {
    font-size: 14px;
    margin-bottom: 4px; /* Reduced margin */
    font-weight: 600;
}

.skill-bar {
    height: 8px; /* Reduced height */
    background-color: var(--secondary-bg);
    border-radius: 4px;
    overflow: hidden;
}

.skill-level {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 4px;
    width: 0;
    transition: width 1s ease-in-out;
}

/* Footer */
footer {
    padding: 12px 20px; /* Consistent padding */
    text-align: center;
    font-size: 12px;
    background-color: var(--secondary-bg);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 3px 10px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 999;
}

.theme-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.theme-toggle .fa-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .fa-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .fa-sun {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 0 auto; /* Remove top/bottom margin on smaller screens */
    }
    .profile-section {
        flex-direction: column;
        text-align: center;
        padding: 12px 15px; /* Reduced padding */
    }
    
    .avatar {
        margin-top: -55px;
        margin-bottom: 15px; /* Reduced margin */
        width: 100px;
        height: 100px;
    }
    
    .profile-info {
        margin-left: 0;
    }
    
    .contact-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px; /* Adjusted gap */
        padding: 12px 15px; /* Reduced padding */
    }
    
    .btn {
        width: auto;
        margin: 0;
        flex: 0 1 auto;
        min-width: 0;
        max-width: 110px;
        padding: 9px 14px; /* Slightly adjusted padding */
    }
    
    .skills-container {
        grid-template-columns: 1fr;
    }
    .social-links, .skills-section, footer {
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        border-radius: 0;
        box-shadow: none;
        width: 100%;
    }
    
    .cover-image {
        height: 140px; /* Reduced height */
    }
    
    .avatar {
        width: 90px;
        height: 90px;
        margin-top: -45px;
        border-width: 3px;
    }
    
    .social-icons {
        grid-template-columns: repeat(auto-fit, minmax(45px, 1fr)); /* Adjusted minmax */
        gap: 12px; /* Reduced gap */
    }
    
    .social-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    .contact-buttons {
        padding: 10px 10px 12px; /* Reduced padding */
        gap: 8px; /* Reduced gap */
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 0;
        flex: 0 1 auto;
        max-width: 100px;
    }
    .btn i {
        margin-right: 6px;
        font-size: 13px;
    }
    .social-links, .skills-section, footer {
        padding-left: 10px;
        padding-right: 10px;
    }
}