@import url('https://fonts.googleapis.com/css2?family=Bitcount+Prop+Single:wght@100..900&family=Nosifer&family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Playwrite+AU+NSW:wght@100..400&display=swap'); 
:root {
   --bg-dark: #080344;
   --bg-light: #f9f9f9;
   --text-dark: #e0e0e0;
    --text-light: #1a1a1a;

    --accent: #00ffc8;
    --border-dark: #333;
    --border-light: #ccc;
    
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.dark {
    --bg-color: #080344;
    --text-color: #f0f0f0;
    --card-bg: #1e1e1e;
    --button-bg: #eee;
    --button-text: #111;
}
body {
    font-family: 'Bitcount Prop Single', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
    padding: 20px;
    margin: 0;
  
}
body:not(.dark) {
    --bg-color: #8693cf;
    --text-color: #192c2c;
    --card-bg: rgb(127, 135, 207);
    --button-bg: #2f42a1;
    --button-text: white;
}
.container, .card {
    background-color: var(--card-bg);
}

button {
    background-color: var(--card-bg);
    color: var(--button-text);
    border: none;
    padding: 10px 10px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
}
/*Fonts for texts headings */
body {
    font-family: 'Bitcount Prop Single', sans-serif;
}
h1 {
    font-family: 'Nosifer', cursive;
    font-size: 2rem;
}
h2 {
    font-family: 'Playfair Display', serif;
}
p {
    font-family: 'Playwrite AU NSW', serif;
}

.converter {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    margin: 40px auto;
    color: var(--text-color);
    animation: fadeIn 0.8s ease;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    transition: 0.3s ease;
}
.converter:hover {
    box-shadow: 
    0 0 30px rgba(255, 255, 255, 0.6),
    0 0 60px rgba(0, 255, 255, 0.3),
    0 0 100px rgba(0, 255, 255, 0.15);
}

/*Heading inside the converter*/
h1, h2 {
    font-weight: 500;
    margin: 10px 0 5px;
    display: block;
}
strong {
    font-size: 1.5rem;
    font-weight: bold;
}
label {
    display: block;
    margin: 10px 0 5px;
    font-weight: 500;
    font-size: 1.3rem;
}

input, select {
    width: 250px;
    padding: 19px 20px;
    font-size: 1rem;
    margin-bottom: 20px;
    border: ridge;
    border-radius: 12px;
    outline: dotted aliceblue;
    background-color: rgb(57 47 115 / 79%);
    color: #d9e3e3;
}

input::placeholder {
    color: #8774f7;
    font-size: 1.1rem;
}

/*Action button*/
button {
    width: 250px;
    background: #bdabdf;
    padding: 12px 20px;
    font-size: 1.2rem;
    border: ridge aliceblue;
    outline: dotted;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 30px;
}

button:hover {
    background-color: #837ce0;
}

/*Out-put text */
.output p {
    margin: 8px 0;
    font-size: 1rem;
}

.output span {
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.output span:hover {
    color: #ffeb3b;
    text-decoration: underline;
}

hr {
    margin: 30px 0;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.3);
}

/*Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result {
    color: #ffd700;
    font-style: italic;
}

select {
    background-color: #4850a3;
    border: 1px solid #164f46;
    padding: 8px;
    font-size: 1.1rem;
    border-radius: 12px;
    border: ridge aliceblue;
}
select option {
    background-color: #333;
}
select:focus {
    outline: none;
    box-shadow: 0 0 5px rgba(0, 0, 255, 0.5);
}

.ascii-table-section {
    text-align: center;
    margin-top: 50px;
}

#ascii-search {
    padding: 20px 15px;
    border-radius: 10px;
    border: none;
    margin-bottom: 20px;
    width: 80%;
    max-width: 400px;
}
.ascii-table-wrapper {
    overflow-x: auto;
    max-height: 400px;
}
#ascii-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
}
#ascii-table th, #ascii-table td {
    padding: 10px;
    border: 1px solid #ccc;
    font-size: 1.3rem;
}
#ascii-table th {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
}
/*Sticky Table Headers */
#ascii-table thead th {
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
    z-index: 1;
}

/*Theme toggle button */
.theme-toggle-wrapper {
    position: fixed;
    top: 1rem;
    right: 1rem;
    border: none;
    cursor: pointer;
    z-index: 1000;
    transform: rotate(0deg);
    transition: transform 0.3s;
}
.theme-toggle-wrapper.rotate {
    transform: rotate(360deg);
}
 
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccc;
    border-radius: 34px;
    transition: 0.4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: 0.4s;
}

input:checked + .slider {
    background-color: #2196f3;
}
input:checked + .slider:before {
    transform: translateX(24px);
}

/*Full-screen canvas for Matrix rain */
#matrixCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background: transparent;
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.5rem;
        text-align: center;
    }
    h2 {
        font-size: 1.2rem;
    }
    .theme-toggle-wrapper {
        top: 0.5rem;
        right: 0.5rem;
        transform: scale(0.85);
    }
    #ascii-search {
        width: 100%;
        font-size: 0.9rem;
    }
}