/* Enhanced CSS with Security Features and improved design */
:root {
    --primary-color: #3498db;
    --secondary-color: #27ae60;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --danger-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --accent-color: #9b59b6;
    --security-color: #2ecc71;
    --text-color: #333;
    --background-color: #f9f9f9;
    --card-shadow: 0 10px 20px rgba(0,0,0,0.12);
    --hover-shadow: 0 14px 28px rgba(0,0,0,0.25);
    --transition: all 0.3s ease;
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header & Navigation */
header {
    background: linear-gradient(135deg, var(--dark-color) 0%, #1a2530 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-weight: bold;
    font-size: 1.5rem;
    color: white;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin: 0 10px;
    position: relative;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 30px;
    transition: var(--transition);
    display: inline-block;
}

.nav-links a:hover, 
.nav-links a[aria-current="page"] {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    background: var(--secondary-color);
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 70%;
}

/* Mobile Navigation */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 5px;
    transition: var(--transition);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 99;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Profile Section */
.profile-header {
    text-align: center;
    margin: 30px 0;
    position: relative;
}

.profile-img-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.profile-img {
    display: block;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 0 auto;
    border: 5px solid var(--secondary-color);
    box-shadow: var(--card-shadow);
    object-fit: cover;
    transition: var(--transition);
}

.profile-img:hover {
    transform: scale(1.05);
    box-shadow: var(--hover-shadow);
}

.profile-title {
    font-size: 1.2rem;
    color: var(--dark-color);
    margin-top: 10px;
    font-weight: 500;
}

/* Sustainability Badge */
.sustainability-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--secondary-color);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Security Badge */
.security-badge {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, var(--security-color) 0%, #27ae60 100%);
    color: white;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--card-shadow);
}

.security-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: bold;
    margin-bottom: 5px;
}

.security-features small {
    opacity: 0.9;
}

/* Sections */
section {
    margin: 30px 0;
    padding: 25px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

section:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

h1, h2, h3 {
    color: var(--dark-color);
    margin-bottom: 20px;
    position: relative;
}

h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    text-align: center;
    margin-top: 20px;
}

h2 {
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 4px;
    background: var(--accent-color);
    bottom: -2px;
    left: 0;
    border-radius: 2px;
}

/* Sustainability Focus Section */
.sustainability-grid, .goals-grid, .initiatives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.sustainability-card, .goal-card, .initiative-card {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    padding: 25px 20px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    border-left: 4px solid var(--secondary-color);
}

.sustainability-card:hover, .goal-card:hover, .initiative-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
    border-left: 4px solid var(--accent-color);
}

.sustainability-card i, .goal-card i, .initiative-card i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    background: var(--light-color);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.sustainability-card:hover i, .goal-card:hover i, .initiative-card:hover i {
    background: var(--secondary-color);
    color: white;
    transform: rotateY(180deg);
}

/* Lists */
ul, ol {
    padding-left: 25px;
    margin: 20px 0;
}

li {
    margin-bottom: 12px;
    transition: transform 0.2s ease;
    padding-left: 5px;
}

li:hover {
    transform: translateX(5px);
}

.classes-list li, .skills-list li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.classes-list i, .skills-list i {
    color: var(--secondary-color);
    font-size: 1.2rem;
    width: 25px;
}

/* Moods Section */
.moods {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.moods figure {
    text-align: center;
    margin: 10px;
    flex: 1;
    min-width: 150px;
    transition: transform 0.3s ease;
}

.moods figure:hover {
    transform: scale(1.05);
}

.moods img {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: var(--transition);
    width: 100%;
    height: auto;
    max-width: 100%;
}

.moods img:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

figcaption {
    margin-top: 10px;
    font-weight: 600;
    color: var(--dark-color);
}

/* Friends Section */
.friends {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.friend-card {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    padding: 25px 20px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    border-left: 4px solid var(--secondary-color);
}

.friend-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
    border-left: 4px solid var(--accent-color);
}

/* Friend Images */
.friend-card img.friend-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 15px;
    border: 4px solid var(--secondary-color);
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.friend-card img.friend-img:hover {
    transform: scale(1.08);
    border-color: var(--accent-color);
}

.friend-card h3 {
    margin-top: 10px;
    font-size: 1.2rem;
    color: var(--dark-color);
}

.friend-card p {
    margin-top: 8px;
    font-size: 0.95rem;
    color: #555;
}

/* Contact Page Styles */
.hero {
    text-align: center;
    margin-bottom: 40px;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--dark-color);
    opacity: 0.8;
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.contact-card {
    text-align: center;
    padding: 25px 20px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.contact-card i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.contact-form {
    margin-top: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2);
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group input {
    width: auto;
    margin-right: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    gap: 8px;
    min-height: 44px;
}

.btn:hover {
    background-color: #219653;
    transform: translateY(-2px);
}

.help-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
}

.error-message {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

.required {
    color: var(--danger-color);
}

.interest-list {
    list-style: none;
    padding-left: 0;
}

.interest-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.interest-list i {
    color: var(--secondary-color);
    width: 20px;
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, #1a2530 100%);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
}

.social-links {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.social-links a {
    color: white;
    font-size: 1.5rem;
    transition: var(--transition);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    min-height: 44px;
    min-width: 44px;
}

.social-links a:hover {
    color: var(--secondary-color);
    background: white;
    transform: translateY(-5px);
}

.validation-badges {
    margin-top: 20px;
}

.validation-badge {
    margin: 0 10px;
    height: 31px;
}

/* Responsive Design */
@media (max-width: 968px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 70%;
        max-width: 300px;
        background: var(--dark-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.3s ease;
        padding: 50px 0;
        z-index: 100;
    }
    
    .nav-links.active {
        right: 0;
        box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    }
    
    .nav-links li {
        margin: 15px 0;
        width: 100%;
        text-align: center;
    }
    
    .nav-links a {
        display: block;
        width: 100%;
        padding: 15px;
        border-radius: 0;
    }
    
    .friends, .contact-methods, .sustainability-grid, .goals-grid, .initiatives-grid {
        grid-template-columns: 1fr;
    }
    
    .moods {
        flex-direction: column;
        align-items: center;
    }
    
    .moods figure {
        width: 100%;
        max-width: 250px;
    }
    
    section {
        padding: 20px 15px;
    }
    
    .profile-img {
        width: 150px;
        height: 150px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    section {
        padding: 15px 10px;
        margin: 20px 0;
    }
    
    .friend-img {
        width: 100px;
        height: 100px;
    }
    
    .contact-card, .sustainability-card, .goal-card, .initiative-card, .friend-card {
        padding: 20px 15px;
    }
}

/* Accessibility Improvements */
:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--secondary-color);
    color: white;
    padding: 10px;
    z-index: 100;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    left: 0;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

main section {
    animation: fadeIn 0.5s ease-out;
}

main section:nth-child(2) {
    animation-delay: 0.1s;
}

main section:nth-child(3) {
    animation-delay: 0.2s;
}

main section:nth-child(4) {
    animation-delay: 0.3s;
}

main section:nth-child(5) {
    animation-delay: 0.4s;
}

/* Print Styles */
@media print {
    nav, footer, .profile-img-container::before, .sustainability-badge, .security-badge {
        display: none;
    }
    
    body {
        background: none;
        color: black;
        font-size: 12pt;
    }
    
    .container {
        padding: 0;
        max-width: 100%;
    }
    
    section {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .profile-img {
        width: 100px;
        height: 100px;
    }
    
    a::after {
        content: " (" attr(href) ") ";
        font-size: 0.9em;
        font-weight: normal;
    }
}

/* Enhanced styles for JavaScript interactions */
.error {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2) !important;
}

.form-status {
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    text-align: center;
    font-weight: 500;
}

.form-status.success {
    background-color: rgba(39, 174, 96, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.theme-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
    min-height: 44px;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Fixed Eco Mode - Better contrast for text */
.eco-mode {
    --background-color: #0d1b15;
    --text-color: #e8f5e9;
    --card-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.eco-mode body {
    color: #e8f5e9;
    background-color: #0d1b15;
}

.eco-mode section {
    background-color: #1a2e25;
    color: #e8f5e9;
}

.eco-mode h1,
.eco-mode h2,
.eco-mode h3 {
    color: #e8f5e9;
}

.eco-mode .sustainability-card,
.eco-mode .goal-card,
.eco-mode .initiative-card,
.eco-mode .friend-card,
.eco-mode .contact-card {
    background: linear-gradient(145deg, #1a2e25, #0d1b15);
    color: #e8f5e9;
}

.eco-mode .profile-title,
.eco-mode figcaption,
.eco-mode .friend-card h3,
.eco-mode .friend-card p,
.eco-mode .subtitle {
    color: #e8f5e9;
}

.eco-mode .classes-list i,
.eco-mode .skills-list i,
.eco-mode .interest-list i {
    color: var(--secondary-color);
}

.eco-mode .help-text {
    color: #a8d5b9;
}

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: none;
    box-shadow: var(--card-shadow);
    z-index: 99;
    transition: var(--transition);
    min-height: 44px;
    min-width: 44px;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.initiative-card.active {
    transform: scale(1.03);
    border-left: 4px solid var(--accent-color);
}

.counter {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
}

/* Animation for form elements */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s;
}

/* Security-specific styles */
.security-notice {
    background: linear-gradient(135deg, var(--security-color) 0%, #27ae60 100%);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 10px 0;
    text-align: center;
    font-size: 0.9rem;
}

.security-feature {
    border-left: 4px solid var(--security-color);
    padding-left: 15px;
    margin: 10px 0;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .scroll-to-top, .theme-toggle, .initiative-card {
        transition: none;
    }
    
    .shake {
        animation: none;
    }
}