@import url('https://fonts.googleapis.com/css?family=Raleway');

/* Color Variables */
:root {
    --color-primary: #232323; /* Dark grey text */
    --color-secondary: #ddd; /* Light grey background */
    --color-accent: #f4a261; /* Warm accent color */
    --color-white: #fff; /* White */
    --color-dark-text: #232323; /* For dark mode card text */
}

/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Basic styles */
body {
    font-family: 'Raleway', sans-serif;
    line-height: 1.6;
    color: var(--color-primary);
    background-color: var(--color-white);
}

/* Unified Brackets Effect */
.brackets-effect {
    position: relative;
    display: inline-block;
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

/* Before and After common styles */
.brackets-effect::before,
.brackets-effect::after {
    display: inline-block;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.2s ease;
    color: var(--color-accent);
}

.brackets-effect::before {
    content: '[';
    margin-right: 10px;
    transform: translateX(20px);
}

.brackets-effect::after {
    content: ']';
    margin-left: 10px;
    transform: translateX(-20px);
}

.brackets-effect:hover::before,
.brackets-effect:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.brackets-effect:hover {
    color: var(--color-primary);
}

/* Additional specific styles for each element type */
/* Navbar links specific styles */
.navbar-nav .nav-link.brackets-effect {
    margin: 0 7px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    font-size: 1rem;
}

/* Email link specific styles */
.contact-email a.brackets-effect {
    font-size: 1.2rem;
    font-weight: normal;
}

/* CV download specific styles */
.cv-download.brackets-effect {
    font-size: 1.2rem;
    font-weight: normal;
    padding: 10px 15px;
}

/* Certificate button specific styles */
.btn-certificate.brackets-effect {
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: 15px;
    padding: 8px 15px;
    background-color: transparent;
    border: none;
}

/* Special download icon animation */
.btn-certificate.brackets-effect .fa-download {
    transition: transform 0.3s ease;
}

.btn-certificate.brackets-effect:hover .fa-download {
    transform: translateY(3px);
}

/* Dark mode adjustments for bracket effects */
body.dark-mode .brackets-effect,
body.dark-mode .navbar-nav .nav-link.brackets-effect {
    color: var(--color-primary); /* Use the primary color in dark mode (which becomes light) */
}

body.dark-mode .brackets-effect:hover {
    color: var(--color-primary);
}

/* Exceptions for special cases where we want to keep the text dark even in dark mode */
body.dark-mode #home .my-email.brackets-effect,
body.dark-mode #home .social-icons a.brackets-effect,
body.dark-mode .certification-card .btn-certificate.brackets-effect {
    color: var(--color-dark-text);
}

body.dark-mode #home .my-email.brackets-effect:hover,
body.dark-mode #home .social-icons a.brackets-effect:hover,
body.dark-mode .certification-card .btn-certificate.brackets-effect:hover {
    color: var(--color-accent);
}

/* 404 page button specific styles */
.btn-404.brackets-effect {
    font-size: 1.2rem;
    font-weight: normal;
    padding: 10px 15px;
}

/* Generic section styles */
section {
    padding: 60px 0;
    text-align: center;
}

/* Section-specific styles */
#home {
    background-color: var(--color-secondary);
    border-bottom: 5px solid var(--color-accent);
}

#about {
    background-color: var(--color-white);
}

#portfolio {
    background-color: var(--color-secondary);
}

/* Titles */
h1 {
    font-size: 3rem; /* Larger size for the main title */
    font-weight: 700; /* Higher weight to highlight the title */
    margin-bottom: 20px; /* Bottom space for the title */
}

h2 {
    font-size: 2.5rem; /* Increased size for subtitles */
    font-weight: 600; /* Higher weight to highlight */
    margin-bottom: 15px;
}

/* Paragraphs */
p {
    font-size: 1.2rem; /* Slightly increased for better readability */
    line-height: 1.8; /* Added line spacing for better text appearance */
    margin-bottom: 20px; /* Space between paragraphs to give text some breathing room */
}

/* Custom styles for the navbar */
.navbar {
    background-color: var(--color-white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--color-primary);
}

    /* Hamburger Menu styling */
    .navbar-toggler {
        border: none; /* Removes any visible border */
        box-shadow: none; /* Removes any shadow */
        outline: none; /* No outline for focus */
    }

    .navbar-toggler:focus {
        outline: none; /* Removes default focus border */
        box-shadow: none; /* Removes focus shadow */
    }

    /* Animated icon for the hamburger menu */
    .animated-icon2 {
        width: 30px;
        height: 20px;
        position: relative;
        margin: 0px;
        transform: rotate(0deg);
        transition: 0.5s ease-in-out;
        cursor: pointer;
    }

    .animated-icon2 span {
        display: block;
        position: absolute;
        height: 3px;
        width: 100%;
        border-radius: 9px;
        background: var(--color-primary);
        opacity: 1;
        left: 0;
        transform: rotate(0deg);
        transition: 0.25s ease-in-out;
    }

    /* Positioning lines for hamburger icon */
    .animated-icon2 span:nth-child(1) {
        top: 0px;
    }

    .animated-icon2 span:nth-child(2),
    .animated-icon2 span:nth-child(3) {
        top: 10px;
    }

    .animated-icon2 span:nth-child(4) {
        top: 20px;
    }

    .animated-icon2.open span:nth-child(1) {
        top: 11px;
        width: 0%;
        left: 50%;
    }

    .animated-icon2.open span:nth-child(2) {
        transform: rotate(45deg);
        background: var(--color-accent);
    }

    .animated-icon2.open span:nth-child(3) {
        transform: rotate(-45deg);
        background: var(--color-accent);
    }

    .animated-icon2.open span:nth-child(4) {
        top: 11px;
        width: 0%;
        left: 50%;
}

/* Dark mode toggle button styles */
.btn-custom {
    background-color: var(--color-secondary);
    border-color: var(--color-primary);
    color: var(--color-primary);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.btn-custom:hover {
    background-color: var(--color-accent);
    border-color: var(--color-primary);
    color: var(--color-primary) !important;
}

/* Dark Mode */
body.dark-mode {
    --color-primary: #f0f0f0; /* Text color */
    --color-secondary: #333;  /* Section background */
    --color-accent: #ff7f50;  /* Accent color */
    --color-dark-text: #232323; /* Keep dark text for cards */
    background-color: #121212;
}

.dark-mode .navbar {
    background-color: var(--color-secondary-dark) !important;
    background-color: var(--color-secondary);
}

.dark-mode .about {
    background-color: var(--color-secondary-dark) !important;
    color: var(--color-white);
}

.dark-mode .carousel-img img {
    border: 1px solid #555;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: var(--color-accent);
    transition: transform 0.3s ease;
}

.carousel-control-prev-icon:hover,
.carousel-control-next-icon:hover {
    transform: translateX(-10px);
    color: var(--color-primary);
}

.dark-mode .carousel-text{
    background-color: #333;
}

.dark-mode .carousel-text h3,
.dark-mode .carousel-text p {
    color: var(--color-primary);
}

/* Card styling for home section */
#home .card {
    border-radius: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--color-white);
    border: none;
    height: 100%;
}

    /* Image-only card styling */
    #home .profile-card {
        padding: 0;
        overflow: hidden;
        border-radius: 15px;
    }

    #home .profile-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 15px;
        transition: transform 0.5s ease;
    }

    #home .profile-card:hover img {
        transform: scale(1.05);
    }

    /* Profile card text styling */
    #home .profile-card .card-img-overlay {
        background: linear-gradient(to top, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 50%);
        border-radius: 15px;
    }

    #home .profile-card .card-title,
    #home .profile-card .card-text {
        color: var(--color-primary);
        text-shadow: 0px 0px 3px rgba(255,255,255,0.8);
        font-weight: 600;
    }

/* Dark mode adjustments for cards */
body.dark-mode #home .profile-card .card-img-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 50%);
}

body.dark-mode #home .profile-card .card-title,
body.dark-mode #home .profile-card .card-text {
    color: var(--color-white);
    text-shadow: 0px 0px 3px rgba(0,0,0,0.8);
}

#home .card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

#home .card-body {
    padding: 2rem;
}

#home .card-title {
    color: var(--color-primary);
    margin-bottom: 1rem;
}

#home .card-text {
    color: var(--color-primary);
    font-size: 1rem;
    line-height: 1.6;
}

#home .social-icons a:hover {
    color: var(--color-accent);
    transform: translateX(5px);
}

body.dark-mode #home .card {
    background-color: var(--color-white);
}

body.dark-mode #home .card-title,
body.dark-mode #home .card-text {
    color: var(--color-dark-text);
}

/* Fix for email and social links in dark mode */
body.dark-mode #home .my-email,
body.dark-mode #home .social-icons a {
    color: var(--color-dark-text);
}

/* Also ensure hover states maintain visibility */
body.dark-mode #home .my-email:hover,
body.dark-mode #home .social-icons a:hover {
    color: var(--color-accent);
}

/* Social icons in card */
#home .social-icons a {
    display: flex;
    align-items: center;
    margin: 5px 0;
    font-size: 1.2rem;
    color: var(--color-primary);
    transition: color 0.3s ease, transform 0.3s ease;
    text-decoration: none;
}

#home .social-icons a i {
    margin-right: 10px;
    font-size: 1.5rem;
}

/* Portfolio project cards */
.project-card {
    border-radius: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.project-card .card-body {
    height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.project-card .card-text {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    max-height: 115px;
}

.project-card-link {
    text-decoration: none;
    color: var(--color-primary);
    display: block;
}

.project-img-container {
    height: 200px;
    overflow: hidden;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.5s ease;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.project-card:hover .project-img {
    transform: scale(1.1);
}

/* Dark mode adjustments for project cards */
body.dark-mode .project-card {
    background-color: var(--color-white);
}

body.dark-mode .project-card .card-title,
body.dark-mode .project-card .card-text {
    color: var(--color-dark-text);
}

body.dark-mode .project-card-link {
    color: var(--color-dark-text);
}

body.dark-mode .project-card-link:hover {
    color: var(--color-accent);
}

/* Education & Certifications Section Styles */
#education {
    background-color: var(--color-white); /* White background in light mode */
}

.certification-card {
    border-radius: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.certification-img-container {
    height: 180px;
    overflow: hidden;
    background-color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.certification-img {
    max-width: 100%;
    max-height: 140px;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.certification-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.certification-card:hover .certification-img {
    transform: scale(1.05);
}

.certification-card .card-body {
    padding: 1.5rem;
}

.certification-card .card-title {
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.certification-card .card-text {
    color: var(--color-primary);
    font-size: 1rem;
    line-height: 1.6;
}

.certification-card .cert-id {
    font-size: 0.9rem;
    color: var(--color-accent);
    font-weight: 600;
    margin-top: 1rem;
}

/* Dark mode adjustments */
body.dark-mode #education {
    background-color: #121212; /* Dark background in dark mode */
}

body.dark-mode .certification-card {
    background-color: var(--color-white);
}

body.dark-mode .certification-card .card-title,
body.dark-mode .certification-card .card-text {
    color: var(--color-dark-text);
}

body.dark-mode .btn-certificate {
    color: var(--color-dark-text);
}

body.dark-mode .certification-card .cert-id {
    color: var(--color-accent);
}

    /* "Scroll to Top" button */
    #return-to-top {
        background: var(--color-secondary);
        width: 50px;
        height: 50px;
        border-radius: 50%;
        text-align: center;
        line-height: 50px;
        color: var(--color-white);
        transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
        opacity: 0;
        bottom: 60px;
        z-index: 1000;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #return-to-top.show {
        opacity: 1;
    }

    #return-to-top:hover {
        background-color: var(--color-accent); /* Orange color */
        color: var(--color-primary); /* Black color for the arrow */
        transform: translateY(-5px); /* Slightly move the arrow upward */
    }

/* Footer section */
footer {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 20px 0;
    text-align: center;
    font-size: 0.9rem;
}

/* Responsive design for smaller devices */
@media (max-width: 768px) {
    .project-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .certification-img-container {
        height: 180px;
    }
    
    .certification-card .card-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .carousel-img {
        height: auto;
    }

    .carousel-overlay {
        background-color: rgba(0, 0, 0, 0.7); /* Darker overlay for mobile */
    }
}