@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700&family=Open+Sans&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700&display=swap');

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-gray: #f4f4f4;
    --dark-gray: #333;
}

body, html {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: var(--light-gray);
    color: var(--dark-gray);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    width: 100%;
}

.container {
    width: 80%;
    margin: auto;
    overflow: hidden;
}

header {
    background: var(--dark-gray);
    color: #fff;
    padding: 1rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 120px;
}

header .background-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', monospace;
    font-size: 7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.08);
    z-index: 1;
    white-space: nowrap;
    pointer-events: none;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    max-width: 100vw; /* Prevent horizontal overflow */
    overflow: hidden;
}

header .container {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

header h1 {
    margin: 0;
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
}

main {
    padding: 1rem;
    flex: 1;
}

footer {
    width: 100%;
    text-align: center;
    padding: 1rem;
    background: var(--dark-gray);
    color: #fff;
}

.footer-content {
    width: 80%;
    margin: 0 auto;
    max-width: 1200px;
}

footer a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #fff;
    text-decoration: underline;
}

h1, h2 {
    font-family: 'Montserrat', sans-serif;
}

#hero {
    background: var(--primary-color); /* Removed the image background */
    color: #fff;
    height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

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

.card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.malaiwah-logo {
    float: left;
    margin-right: 20px; /* Adjust as needed for spacing */
    width: 300px; /* Set to original width */
    height: auto; /* Maintain aspect ratio */
}

.hero-image {
    max-width: 100%; /* Ensure image is responsive */
    height: auto; /* Maintain aspect ratio */
    border-radius: 50%; /* Make it circular */
    width: 500px; /* Increased size */
    height: 500px; /* Increased size */
    object-fit: cover; /* Cover the area without distortion */
    border: 5px solid #fff; /* Add a white border */
    box-shadow: 0 0 10px rgba(0,0,0,0.5); /* Add a subtle shadow */
}

.hero-image-container {
    position: relative; /* For positioning the overlays */
    width: 500px; /* Same as hero-image width */
    height: 500px; /* Same as hero-image height */
    border-radius: 50%; /* Match image border-radius */
    overflow: hidden; /* Hide overflow from overlays */
}

.overlay {
    position: absolute;
    top: 0;
    width: 50%; /* Half of the image width */
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Transparent black */
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease; /* Smooth transition */
    padding: 10px; /* Add some padding */
    box-sizing: border-box; /* Include padding in width/height */
    text-align: center;
}

.overlay-left {
    left: 0;
}

.overlay-right {
    right: 0;
}

.overlay-left:hover {
    opacity: 1; /* Show on hover */
}

.overlay-right:hover {
    opacity: 1; /* Show on hover */
}

.social-links {
    margin-top: 20px;
    display: flex;
    gap: 15px; /* Space between icons */
}

.social-links a {
    color: #fff; /* White icons */
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--secondary-color); /* Change color on hover */
}

.small-text {
    font-size: 0.875em;
    color: #666;
    margin-top: 15px;
}

/* Tag Cloud Styles */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    line-height: 1.4;
    margin-top: 15px;
    justify-content: flex-start;
    align-items: center;
}

/* Category-based colors */
.skill-tag {
    display: inline-block;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
    position: relative;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    animation: tagFadeIn 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

/* Animation delay for staggered effect */
.skill-tag:nth-child(1) { animation-delay: 0.1s; }
.skill-tag:nth-child(2) { animation-delay: 0.2s; }
.skill-tag:nth-child(3) { animation-delay: 0.3s; }
.skill-tag:nth-child(4) { animation-delay: 0.4s; }
.skill-tag:nth-child(5) { animation-delay: 0.5s; }
.skill-tag:nth-child(6) { animation-delay: 0.6s; }
.skill-tag:nth-child(7) { animation-delay: 0.7s; }
.skill-tag:nth-child(8) { animation-delay: 0.8s; }
.skill-tag:nth-child(9) { animation-delay: 0.9s; }
.skill-tag:nth-child(10) { animation-delay: 1.0s; }
.skill-tag:nth-child(11) { animation-delay: 1.1s; }
.skill-tag:nth-child(12) { animation-delay: 1.2s; }
.skill-tag:nth-child(13) { animation-delay: 1.3s; }
.skill-tag:nth-child(14) { animation-delay: 1.4s; }
.skill-tag:nth-child(15) { animation-delay: 1.5s; }
.skill-tag:nth-child(16) { animation-delay: 1.6s; }
.skill-tag:nth-child(17) { animation-delay: 1.7s; }
.skill-tag:nth-child(18) { animation-delay: 1.8s; }
.skill-tag:nth-child(19) { animation-delay: 1.9s; }
.skill-tag:nth-child(20) { animation-delay: 2.0s; }

/* Weight-based sizing */
.skill-tag[data-weight="1"] { font-size: 0.7em; padding: 3px 8px; }
.skill-tag[data-weight="2"] { font-size: 0.8em; padding: 4px 10px; }
.skill-tag[data-weight="3"] { font-size: 0.9em; padding: 4px 12px; }
.skill-tag[data-weight="4"] { font-size: 1.0em; padding: 5px 14px; }
.skill-tag[data-weight="5"] { font-size: 1.1em; padding: 6px 16px; }

/* Category colors */
.tag-primary {
    background: linear-gradient(135deg, var(--secondary-color), #5dade2);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

.tag-infrastructure {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.2);
}

.tag-programming {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    box-shadow: 0 2px 4px rgba(155, 89, 182, 0.2);
}

.tag-networking {
    background: linear-gradient(135deg, #e67e22, #d35400);
    box-shadow: 0 2px 4px rgba(230, 126, 34, 0.2);
}

.tag-telephony {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    box-shadow: 0 2px 4px rgba(142, 68, 173, 0.2);
}

.tag-business {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    box-shadow: 0 2px 4px rgba(44, 62, 80, 0.2);
}

.tag-tools {
    background: linear-gradient(135deg, #3498db, var(--secondary-color));
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

.tag-other {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    box-shadow: 0 2px 4px rgba(149, 165, 166, 0.2);
}

/* Hover effects */
.skill-tag:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

.skill-tag:active {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Animation keyframes */
@keyframes tagFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* IPv4/IPv6 Detection Ribbon */
.ip-ribbon {
    position: fixed;
    top: 20px;
    right: -30px;
    background-color: var(--accent-color);
    color: white;
    padding: 5px 40px 5px 15px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 1000;
    transform: rotate(45deg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    transition: all 0.3s ease;
    overflow: visible;
}

.ip-ribbon:hover {
    cursor: pointer;
    opacity: 0.8;
    transform: rotate(45deg) scale(1.05);
}

#ip-indicator {
    white-space: nowrap;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body, html {
        overflow-x: hidden; /* Ensure no horizontal scrolling on tablets */
    }

    .container {
        width: 95%;
        padding: 0 10px;
    }

    header {
        min-height: 100px;
    }

    header .background-text {
        font-size: 4rem;
        letter-spacing: 0.05em;
    }

    main {
        padding: 0.5rem;
    }

    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .card-container {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .malaiwah-logo {
        float: none;
        width: 200px;
        display: block;
        margin: 0 auto 1rem auto;
    }

    .hero-image {
        width: 300px;
        height: 300px;
    }

    .hero-image-container {
        width: 300px;
        height: 300px;
    }

    #hero {
        height: 40vh;
        padding: 1rem 0;
    }

    .tag-cloud {
        justify-content: center;
        gap: 6px;
    }

    .skill-tag {
        animation-duration: 0.4s;
    }

    .skill-tag[data-weight="1"] { font-size: 0.6em; padding: 2px 6px; }
    .skill-tag[data-weight="2"] { font-size: 0.7em; padding: 3px 7px; }
    .skill-tag[data-weight="3"] { font-size: 0.8em; padding: 3px 8px; }
    .skill-tag[data-weight="4"] { font-size: 0.9em; padding: 4px 10px; }
    .skill-tag[data-weight="5"] { font-size: 1.0em; padding: 4px 12px; }
}

@media (max-width: 480px) {
    body, html {
        overflow-x: hidden; /* Ensure no horizontal scrolling on phones */
    }

    header {
        min-height: 80px;
    }

    header .background-text {
        font-size: 3rem;
        letter-spacing: 0.03em;
    }

    header .container {
        min-height: 80px;
    }

    .hero-image {
        width: 250px;
        height: 250px;
    }

    .hero-image-container {
        width: 250px;
        height: 250px;
    }

    footer {
        padding: 0.5rem;
        text-align: center;
    }

    .footer-content {
        width: 95%;
        padding: 0 10px;
    }

    .ip-ribbon {
        font-size: 0.7em;
        padding: 3px 30px 3px 10px;
    }
}
