/* =========================================================================
   KAZI TOOLS PRO - PREMIUM DESKTOP SYSTEM
   = = = = = = == = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
   */
@import url('https://fonts.googleapis.com/css?family=Outfit:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&display=swap');

:root {
    --bg-base: #030712;
    --panel-bg: rgba(17, 24, 39, 0.75);
    /* #111827 / opacity */
    --panel-border: rgba(255, 255, 255, 0.08);
    /* slight border */

    --h-primary: #10b981 emerald --text-primary: #fbfbfb;
    --primary: #18eaa0;
    --primary-dim: #058866;

    --secondary: #3b82f6;
    --text-main: #f8fafc;
    --text-muted: #9baac8;

    --bg-code: rgba(8, 11, 28, 0.85);

    --accent: #10b98f;
    --error-bg: #2d1112;
    --error: #ef5358;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    padding-bottom: 20px;
    overflow-x: hidden;
    /* --- NEW PREMIUM ANIMATED MESH BACKGROUND --- */
    background: #020617;
    /* Deep slate baseline */
    position: relative;
    z-index: 1;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background:
        radial-gradient(circle at 15% 50%, rgba(16, 185, 129, 0.15), transparent 45%),
        radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.15), transparent 45%),
        radial-gradient(circle at 50% 80%, rgba(139, 92, 246, 0.12), transparent 45%);
    background-size: 200% 200%;
    animation: gradientMove 15s ease infinite alternate;
    z-index: -1;
    pointer-events: none;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 100% 100%;
    }
}

/* --- Header / Nav --- */
.header {
    background: rgba(15, 15, 15, 0.45) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--panel-border) !important;
    padding: 16px 36px !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    top: 0;
    position: sticky;
    z-index: 100;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main) !important;
    text-decoration: none;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon i {
    color: var(--primary);
}

.hamburger {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s;
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.close-sidebar {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s;
}

.close-sidebar:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Desktop override sidebar as flex headers optionally? Currently the UI uses a sidebar toggle. */
.sidebar {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: rgba(10, 15, 23, 0.95) !important;
    backdrop-filter: blur(15px);
    border-left: 1px solid var(--panel-border);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--panel-border);
}

.sidebar-header .logo-text {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 2px;
    margin: 0;
    display: flex;
    align-items: center;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 20px 10px;
    flex: 1;
    overflow-y: auto;
}

/* Custom scrollbar for sidebar nav */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-nav .nav-item {
    color: var(--text-muted) !important;
    text-decoration: none;
    padding: 15px 20px;
    margin: 4px 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s;
}

.sidebar-nav .nav-item:hover,
.sidebar-nav .nav-item.active {
    background: rgba(16, 185, 129, 0.1) !important;
    color: var(--primary) !important;
    transform: translateX(4px);
}

.sidebar-nav .nav-item i {
    width: 18px;
    height: 18px;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}


/* --- General Page Layout --- */
.page-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    /* Height minus header */
    padding: 30px 20px;
    box-sizing: border-box;
}

.container {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    padding: 35px 40px;
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    width: 100%;
    max-width: 680px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    box-sizing: border-box;
}

/* For full grid UI sections like Homepage */
.container.grid-mode {
    max-width: 1050px;
    background: transparent;
    border: none;
    backdrop-filter: none;
    box-shadow: none;
    padding: 0;
}

h2 {
    text-align: center;
    color: var(--text-main);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 35px;
    font-size: 1.4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

h2::after,
h2::before {
    content: '';
    width: 30px;
    height: 2px;
    background: var(--primary);
    opacity: 0.5;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-main);
    font-family: 'Fira Code', monospace;
    font-size: 15px;
    margin-bottom: 22px;
    box-sizing: border-box;
    outline: none;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    background: rgba(0, 0, 0, 0.6);
}

select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2310b981%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E"), linear-gradient(to bottom, transparent 0%, transparent 100%);
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
}

select option {
    background-color: var(--bg-base);
    color: var(--text-main);
    padding: 10px;
}

.grid-input {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.gen-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), #0d9668);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    font-size: 16px;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

.gen-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #18eaa0, #10b981);
}

.gen-btn:active {
    transform: translateY(0);
}

.output-container {
    width: 100%;
    height: 280px;
    background: var(--bg-code);
    color: var(--text-main);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 15px;
    font-family: 'Fira Code', monospace;
    overflow-y: auto;
    resize: vertical;
    box-sizing: border-box;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.output-placeholder {
    color: rgba(255, 255, 255, 0.2);
    padding: 10px;
    text-align: center;
    font-style: italic;
    font-family: 'Outfit';
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s;
}

.result-row:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.result-text {
    word-break: break-all;
    margin-right: 15px;
    flex: 1;
    min-width: 0;
    color: #e2e8f0;
}

.btn-copy-single {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-copy-single:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.copy-btn {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    font-size: 14px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    font-family: 'Outfit';
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Toast Notifications */
.toast-overlay {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: none;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    text-align: center;
    min-width: 320px;
    animation: slideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-overlay.error {
    border-color: var(--error);
}

.toast-overlay h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
}

.toast-overlay.error h3 {
    color: var(--error);
}

.toast-overlay p {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

@keyframes slideDown {
    from {
        top: -50px;
        opacity: 0;
    }

    to {
        top: 30px;
        opacity: 1;
    }
}

/* Responsive constraints */
@media (max-width: 650px) {
    .header {
        padding: 12px 15px !important;
    }

    .page-wrapper {
        padding: 15px 10px;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .container {
        padding: 20px 15px;
        border-radius: 14px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .hero-title {
        font-size: 2.2rem !important;
    }

    .grid-input {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .result-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .result-text {
        width: 100%;
        margin-right: 0;
        word-wrap: break-word;
        white-space: pre-wrap;
        box-sizing: border-box;
    }

    .btn-copy-single {
        width: 100%;
        padding: 10px;
    }
}

/ *   - - -   H e r o   S e c t i o n   - - -   * /   . h e r o - s e c t i o n    {
               t e x t - a l i g n :    c e n t e r ;
               p a d d i n g :    6 0 p x   2 0 p x   4 0 p x   2 0 p x ;
               b o r d e r - b o t t o m :    1 p x   s o l i d   v a r ( - - p a n e l - b o r d e r ) ;
               m a r g i n - b o t t o m :    3 0 p x ;
               p o s i t i o n :    r e l a t i v e ;
               o v e r f l o w :    h i d d e n ;
       
}

     . h e r o - s e c t i o n : : a f t e r    {
               c o n t e n t :    ' '  ;
               p o s i t i o n :    a b s o l u t e ;
               b o t t o m :    - 1 p x ;
               l e f t :    2 0 % ;
               r i g h t :    2 0 % ;
               h e i g h t :    1 p x ;
               b a c k g r o u n d :    l i n e a r - g r a d i e n t ( 9 0 d e g ,    t r a n s p a r e n t ,    v a r ( - - p r i m a r y ) ,    t r a n s p a r e n t ) ;
       
}

     . h e r o - t i t l e    {
               f o n t - s i z e :    2 . 8 r e m ;
               f o n t - w e i g h t :    8 0 0 ;
               m a r g i n :    0   0   1 5 p x   0 ;
               c o l o r :    # f f f ;
               l e t t e r - s p a c i n g :    1 p x ;
               t e x t - s h a d o w :    0   0   2 0 p x   r g b a ( 1 6 ,    1 8 5 ,    1 2 9 ,    0 . 3 ) ;
       
}

     . h e r o - s u b t i t l e    {
               f o n t - s i z e :    1 . 0 5 r e m ;
               c o l o r :    v a r ( - - t e x t - m u t e d ) ;
               m a x - w i d t h :    6 0 0 p x ;
               m a r g i n :    0   a u t o ;
               l i n e - h e i g h t :    1 . 6 ;
               f o n t - f a m i l y :    ' F i r a   C o d e '  ,    m o n o s p a c e ;
       
}

     / *   - - -   T o o l s   G r i d   - - -   * /   . t o o l s - g r i d    {
               d i s p l a y :    g r i d ;
               g r i d - t e m p l a t e - c o l u m n s :    r e p e a t ( a u t o - f i l l ,    m i n m a x ( 2 8 0 p x ,    1 f r ) ) ;
               g a p :    2 0 p x ;
       
}

     / *   - - -   T o o l   C a r d   - - -   * /   . t o o l - c a r d    {
               b a c k g r o u n d :    r g b a ( 1 5 ,    2 0 ,    3 0 ,    0 . 6 ) ;
               b o r d e r :    1 p x   s o l i d   r g b a ( 2 5 5 ,    2 5 5 ,    2 5 5 ,    0 . 0 5 ) ;
               b o r d e r - r a d i u s :    1 2 p x ;
               p a d d i n g :    2 4 p x ;
               t e x t - d e c o r a t i o n :    n o n e ;
               c o l o r :    v a r ( - - t e x t - m a i n ) ;
               t r a n s i t i o n :    a l l   0 . 3 s   c u b i c - b e z i e r ( 0 . 4 ,    0 ,    0 . 2 ,    1 ) ;
               d i s p l a y :    f l e x ;
               f l e x - d i r e c t i o n :    c o l u m n ;
               p o s i t i o n :    r e l a t i v e ;
               o v e r f l o w :    h i d d e n ;
       
}

     . t o o l - c a r d : : b e f o r e    {
               c o n t e n t :    ' '  ;
               p o s i t i o n :    a b s o l u t e ;
               t o p :    0 ;
               l e f t :    0 ;
               w i d t h :    4 p x ;
               h e i g h t :    1 0 0 % ;
               b a c k g r o u n d :    v a r ( - - p r i m a r y ) ;
               o p a c i t y :    0 ;
               t r a n s i t i o n :    o p a c i t y   0 . 3 s ;
       
}

     . t o o l - c a r d : h o v e r    {
               t r a n s f o r m :    t r a n s l a t e Y ( - 5 p x ) ;
               b a c k g r o u n d :    r g b a ( 2 0 ,    2 5 ,    3 5 ,    0 . 8 ) ;
               b o r d e r - c o l o r :    r g b a ( 1 6 ,    1 8 5 ,    1 2 9 ,    0 . 3 ) ;
               b o x - s h a d o w :    0   1 5 p x   3 0 p x   - 1 0 p x   r g b a ( 0 ,    0 ,    0 ,    0 . 5 ) ,    0   0   1 5 p x   r g b a ( 1 6 ,    1 8 5 ,    1 2 9 ,    0 . 1 ) ;
       
}

     . t o o l - c a r d : h o v e r : : b e f o r e    {
               o p a c i t y :    1 ;
       
}

     . t o o l - i c o n    {
               f o n t - f a m i l y :    ' F i r a   C o d e '  ,    m o n o s p a c e ;
               f o n t - s i z e :    1 . 2 r e m ;
               f o n t - w e i g h t :    7 0 0 ;
               b a c k g r o u n d :    r g b a ( 1 6 ,    1 8 5 ,    1 2 9 ,    0 . 1 ) ;
               c o l o r :    v a r ( - - p r i m a r y ) ;
               w i d t h :    4 8 p x ;
               h e i g h t :    4 8 p x ;
               d i s p l a y :    f l e x ;
               j u s t i f y - c o n t e n t :    c e n t e r ;
               a l i g n - i t e m s :    c e n t e r ;
               b o r d e r - r a d i u s :    1 0 p x ;
               m a r g i n - b o t t o m :    2 0 p x ;
               t r a n s i t i o n :    t r a n s f o r m   0 . 3 s ,    b o x - s h a d o w   0 . 3 s ;
       
}

     . t o o l - c a r d : h o v e r   . t o o l - i c o n    {
               t r a n s f o r m :    s c a l e ( 1 . 1 )   r o t a t e ( 2 d e g ) ;
               b o x - s h a d o w :    0   5 p x   1 5 p x   r g b a ( 0 ,  0 ,  0 ,  0 . 3 ) ;
       
}

     . t o o l - t i t l e    {
               f o n t - s i z e :    1 . 2 r e m ;
               f o n t - w e i g h t :    6 0 0 ;
               m a r g i n - b o t t o m :    1 0 p x ;
               c o l o r :    # f f f ;
               l e t t e r - s p a c i n g :    0 . 5 p x ;
       
}

     . t o o l - d e s c    {
               f o n t - s i z e :    0 . 9 r e m ;
               c o l o r :    v a r ( - - t e x t - m u t e d ) ;
               l i n e - h e i g h t :    1 . 5 ;
               f l e x - g r o w :    1 ;
       
}

     @ m e d i a   ( m a x - w i d t h :   6 5 0 p x )    {
               . t o o l s - g r i d    {
                           g r i d - t e m p l a t e - c o l u m n s :    1 f r ;
                   
    }

       
}

       