/* 
   KnowYourDigiPIN.com - Main Stylesheet 
   Colors: #362D73 (Primary), #533CA6 (Secondary)
   Gradient: #E69BFD -> #FFE3A6
*/

:root {
    --primary-color: #362D73;
    --secondary-color: #533CA6;
    --accent-gradient: linear-gradient(135deg, #E69BFD 0%, #FFE3A6 100%);
    --text-dark: #1a1a1a;
    --text-light: #f5f5f5;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius-md: 8px;
    --radius-lg: 16px;
    --font-main: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100vw;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

/* Layout Utilities */
.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    overflow-x: hidden;
}

.section {
    padding: 4rem 0;
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-5 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.flex {
    display: flex;
    gap: 1rem;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--primary-color);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Header */
.header {
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-dark);
    transition: color 0.2s;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.nav-links a:hover {
    color: var(--secondary-color);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 6rem 0;
    text-align: center;
}

.hero h1 {
    color: var(--white);
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.search-bar {
    max-width: 500px;
    margin: 0 auto 2rem;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    border: none;
    font-size: 1rem;
    box-shadow: var(--shadow-md);
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Tool Cards */
/* Tool Cards */
.tool-card {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
    border: 1px solid #eee;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.tool-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--secondary-color);
    background: #f0f2f5;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-bottom: 0.5rem;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: #E69BFD;
}

.tool-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.tool-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.tool-card p {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.tool-link {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header span {
    color: var(--secondary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer h4 {
    color: var(--white);
    margin-bottom: 1.5rem;
}

.footer ul li {
    margin-bottom: 0.75rem;
}

.footer a {
    color: var(--white);
    opacity: 0.9;
    transition: opacity 0.2s;
}

.footer a:hover {
    opacity: 1;
}

.footer p {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 3rem;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

.footer-bottom p {
    color: var(--white);
    opacity: 0.9;
}

/* Responsive */
/* Responsive Styles */

/* Hide mobile menu button by default */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Tablet styles (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        width: 95%;
        padding: 0 1rem;
    }

    .grid-5 {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .grid-4 {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .grid-3 {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

/* Mobile styles (max-width: 768px) */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-menu-btn {
        display: flex;
        z-index: 1001;
        margin-left: auto;
    }

    nav {
        display: contents;
    }

    .logo {
        font-size: 1.1rem;
        text-align: left;
        letter-spacing: 0.5px;
    }

    /* Mobile Menu Overlay */
    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        flex-direction: column;
        padding: 5rem 0 2rem;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
        text-align: left;
        gap: 0;
        z-index: 1002;
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        overflow-y: auto;
    }

    .nav-links.active {
        display: flex;
        right: 0;
    }

    /* Menu Overlay Background */
    .nav-links.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        animation: fadeIn 0.3s ease forwards;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    /* Close button */
    .nav-links::after {
        content: '×';
        position: absolute;
        top: 1rem;
        right: 1.5rem;
        font-size: 2.5rem;
        color: white;
        cursor: pointer;
        font-weight: 300;
        line-height: 1;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background 0.3s ease;
    }

    .nav-links::after:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        display: block;
        padding: 1.25rem 2rem;
        font-size: 1rem;
        color: white;
        font-weight: 500;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }

    .nav-links a::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: 4px;
        background: var(--accent-gradient);
        transform: scaleY(0);
        transition: transform 0.3s ease;
    }

    .nav-links a:hover {
        background-color: rgba(255, 255, 255, 0.1);
        padding-left: 2.5rem;
    }

    .nav-links a:hover::before {
        transform: scaleY(1);
    }

    /* Animated hamburger icon */
    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    /* Typography */
    h1 {
        font-size: 1.85rem;
        line-height: 1.3;
    }

    h2 {
        font-size: 1.6rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    /* Hero Section */
    .hero {
        padding: 2.5rem 0;
    }

    .hero h1 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
        padding: 0 0.5rem;
    }

    .hero p {
        padding: 0 1rem;
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .search-bar {
        max-width: 90%;
        margin: 0 auto 1.5rem;
    }

    .search-bar input {
        padding: 0.85rem 1.25rem;
        font-size: 0.9rem;
    }

    .hero-buttons {
        gap: 0.75rem;
        padding: 0 1rem;
    }

    .hero-buttons .btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }

    /* Sections */
    .section {
        padding: 2.5rem 0;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    /* Grid Layouts */
    .grid {
        gap: 1rem;
    }

    .grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    /* Tool Cards */
    .tool-card {
        padding: 1.25rem 1rem;
    }

    .tool-card h3 {
        font-size: 1rem;
    }

    .tool-card p {
        font-size: 0.8rem;
    }

    .tool-icon {
        font-size: 1.75rem;
    }

    .tool-category {
        font-size: 0.65rem;
        padding: 0.15rem 0.5rem;
    }

    /* Footer */
    .footer {
        text-align: center;
        padding: 3rem 0 1.5rem;
    }

    .footer .grid-4 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer h4 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .footer ul li {
        margin-bottom: 0.5rem;
    }

    .footer-bottom {
        padding-top: 1rem;
        margin-top: 2rem;
    }

    /* Buttons */
    .btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }

    /* Container */
    .container {
        width: 95%;
        padding: 0 0.75rem;
    }
}

/* Small mobile styles (max-width: 480px) */
@media (max-width: 480px) {
    .logo {
        font-size: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: 280px;
    }

    /* Single column for very small screens */
    .grid-5,
    .grid-4,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .tool-card {
        padding: 1rem 0.75rem;
    }

    .section {
        padding: 2rem 0;
    }

    .search-bar {
        max-width: 95%;
    }

    .search-bar input {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
}

/* Extra small devices (max-width: 360px) */
@media (max-width: 360px) {
    .logo {
        font-size: 0.9rem;
    }

    .hero h1 {
        font-size: 1.35rem;
    }

    .hero p {
        font-size: 0.85rem;
    }

    .tool-card h3 {
        font-size: 0.95rem;
    }

    .tool-card p {
        font-size: 0.75rem;
    }

    .mobile-menu-btn span {
        width: 22px;
        height: 2.5px;
    }
}

/* Additional Global Mobile Fixes */
@media (max-width: 768px) {

    /* Ensure no element can cause horizontal scroll */
    html {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Fix for any inline styles with fixed widths */
    img,
    video,
    iframe,
    embed,
    object {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Fix for tables */
    table {
        width: 100% !important;
        display: block;
        overflow-x: auto;
    }

    /* Fix for pre-formatted text */
    pre {
        white-space: pre-wrap;
        word-wrap: break-word;
        overflow-x: auto;
    }

    /* Fix for long words */
    p,
    li,
    td,
    th,
    div,
    span {
        word-break: break-word;
        hyphens: auto;
    }
}