/* CSS Variables */
:root {
    --primary-blue: #013d7a;
    --secondary-blue: #0066cc;
    --accent-pink: #ff3366;
    --light-bg: #f0f7ff;
    --card-bg: #ffffff;
    --text-dark: #333;
    --text-light: #666;
    --border-color: #e1e8f0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --footer-bg: #0a192f;
    --footer-text: #ccd6f6;
    --footer-heading: #e6f1ff;
    --footer-border: #233554;
    --footer-hover: #64ffda;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --suggestion-bg: #e9f7fe;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f0f7ff 0%, #e4edf5 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: white;
    position: sticky;
    top: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: var(--shadow);
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo a {
    text-decoration: none;
    color: var(--footer-bg);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.logo a:hover {
    color: var(--accent-pink);
}

/* Navigation */
.nav-links {
    display: flex;
    margin-left: 30px;
}

.nav-item {
    position: relative;
    color: black;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 10px 16px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.links a {
    color: black;
    text-decoration: none;
    transition: all 0.3s ease;
}

.links a:hover {
    color: var(--accent-pink);
}

.nav-item:hover {
    color: var(--accent-pink);
}

.dropdown-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nav-item:hover .dropdown-icon {
    transform: rotate(180deg);
}

/* Mega Dropdown Styles */
.mega-dropdown {
    position: absolute;
    top: 45px;
    left: -750px;
    background-color: white;
    width: 1200px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 30px;
    display: none;
    z-index: 1001;
    grid-template-columns: repeat(6, 1fr);
    border-top: 3px solid var(--accent-pink);
}

.nav-item:hover .mega-dropdown {
    display: grid;
    animation: fadeIn 0.3s ease;
}

.dropdown-section h3 {
    color: var(--primary-blue);
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.dropdown-section h3 i {
    margin-right: 10px;
    color: var(--accent-pink);
    background: rgba(255, 51, 102, 0.1);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dropdown-link {
    display: flex;
    align-items: center;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.7rem;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.dropdown-link:hover {
    background-color: #f0f7ff;
    color: var(--accent-pink);
}

.dropdown-link i {
    margin-right: 12px;
    color: var(--secondary-blue);
    width: 20px;
    text-align: center;
    font-size: 14px;
}

/* Mobile Toggle */
.mobile-toggle {
    margin-left: auto;
    display: none;
    background: none;
    border: none;
    color: var(--accent-pink);
    font-size: 24px;
    cursor: pointer;
}

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background-color: white;
    z-index: 999;
    transition: all 0.4s ease;
    overflow-y: auto;
    padding: 20px;
    box-shadow: var(--shadow);
}

.mobile-sidebar.active {
    left: 0;
}

.mobile-category {
    margin-top: 20px;
}

.mobile-category-title {
    font-size: 18px;
    color: var(--primary-blue);
    font-weight: 500;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-pink);
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-category-title i {
    color: var(--accent-pink);
}

.mobile-tool-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 8px;
    font-weight: 500;
    transition: all 0.2s;
    background: #f8fafd;
    color: var(--text-dark);
}

.mobile-tool-link:hover {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    transform: translateX(5px);
    color: var(--accent-pink);
}

.mobile-tool-link i {
    margin-right: 15px;
    color: var(--secondary-blue);
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 40px auto 200px;
    padding: 0 20px;
    flex: 1;
    width: 100%;
}

.tool-title {
    text-align: center;
    margin-bottom: 40px;
}

.tool-title h1 {
    color: var(--footer-bg);
    font-size: 2.8rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.tool-title p {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 900px;
    margin: 0 auto;
}

/* Password Generator Container */
.password-generator {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 30px;
    margin: 0 auto;
    max-width: 900px;
}

.password-display {
    position: relative;
    margin-bottom: 25px;
}

.password-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: #f9fbfd;
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.3s;
    padding-right: 160px;
}

.password-input:focus {
    border-color: var(--secondary-blue);
}

.password-actions {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
}

.password-action {
    background: var(--secondary-blue);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.password-action:hover {
    background: var(--primary-blue);
}

.password-strength {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.strength-meter {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.5s, background 0.5s;
}

.strength-text {
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 70px;
}

.password-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 25px;
    background: rgba(240, 247, 255, 0.7);
    padding: 20px;
    border-radius: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-blue);
}

.options-container {
    margin: 25px 0;
}

.option-group {
    margin-bottom: 20px;
}

.option-title {
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 12px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.option-title i {
    color: var(--secondary-blue);
}

.length-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.length-slider {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
}

.length-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--secondary-blue);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.length-value {
    width: 50px;
    text-align: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: white;
    background: var(--secondary-blue);
    padding: 5px 10px;
    border-radius: 6px;
}

.character-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.2s;
}

.option-item:hover {
    background: rgba(240, 247, 255, 0.5);
}

.option-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--secondary-blue);
    cursor: pointer;
}

.option-item label {
    font-size: 1rem;
    color: var(--text-dark);
    cursor: pointer;
}

.generate-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background: var(--secondary-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    margin-top: 20px;
    box-shadow: 0 4px 10px rgba(0, 102, 204, 0.2);
}

.generate-btn:hover {
    background: var(--primary-blue);
    transform: translateY(-2px);
}

.generate-btn:active {
    transform: translateY(0);
}

.password-history {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 30px;
    margin-top: 30px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-title {
    font-size: 1.2rem;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 10px;
}

.clear-history-btn {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: none;
    border-radius: 6px;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.clear-history-btn:hover {
    background: var(--danger);
    color: white;
}

.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.history-item {
    background: #f8fafd;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
    position: relative;
}

.history-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--secondary-blue);
}

.history-password {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    color: var(--primary-blue);
    margin-bottom: 10px;
    padding-right: 20px;
}

.history-actions {
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.history-btn-group {
    display: flex;
    gap: 8px;
}

.history-btn {
    background: rgba(1, 61, 122, 0.1);
    color: var(--primary-blue);
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.history-btn:hover {
    background: var(--secondary-blue);
    color: white;
}

.delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.5;
}

.delete-btn:hover {
    color: var(--danger);
    opacity: 1;
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--success);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast i {
    font-size: 1.2rem;
}

.toast.danger {
    background: var(--danger);
}

.toast.warning {
    background: var(--warning);
}

footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 0.5s ease;
}

.empty-history {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
    font-style: italic;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .mega-dropdown {
        width: 700px;
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .nav-links {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    .mega-dropdown {
        width: 500px;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        height: 70px;
    }

    .logo a {
        font-size: 22px;
    }

    .mobile-sidebar {
        top: 70px;
        height: calc(100vh - 70px);
    }

    .tool-title h1 {
        font-size: 2rem;
    }

    .password-stats {
        grid-template-columns: 1fr;
    }

    .history-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .password-input {
        padding-right: 130px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .password-action span {
        display: none;
    }

    .password-action i {
        margin-right: 0;
    }
}