/* Main CSS for Glyph Project */

/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&family=Orbitron:wght@400;700&display=swap');

/* CSS Variables */
:root {
    --primary-color: #8a2be2;
    --primary-light: #a64dff;
    --primary-dark: #6a0dad;
    --secondary-color: #00ffff;
    --secondary-dark: #00cccc;
    --dark-bg: #121212;
    --darker-bg: #0a0a0a;
    --light-text: #f0f0f0;
    --gray-text: #a0a0a0;
    --card-bg: rgba(20, 20, 20, 0.8);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --glow-shadow: 0 0 10px var(--secondary-color), 0 0 20px var(--secondary-color);
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--dark-bg);
    color: var(--light-text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 100%);
    opacity: 0.9;
    z-index: -2;
}

#particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: space-between;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
    position: relative;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-top: 1rem;
    color: var(--secondary-color);
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

/* Input Section */
.input-section {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.floating-input {
    width: 100%;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    border: 1px solid rgba(138, 43, 226, 0.2);
}

.floating-input:hover, .floating-input:focus-within {
    box-shadow: var(--card-shadow), 0 0 20px rgba(138, 43, 226, 0.4);
    border-color: rgba(138, 43, 226, 0.5);
}

.floating-input::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    background: linear-gradient(45deg, transparent, var(--primary-color), transparent);
    z-index: -1;
    animation: border-glow 3s linear infinite;
    border-radius: 15px;
    opacity: 0.5;
}

textarea {
    width: 100%;
    min-height: 150px;
    padding: 1.5rem;
    background: transparent;
    border: none;
    outline: none;
    color: var(--light-text);
    font-size: 1.1rem;
    resize: vertical;
    max-height: 400px;
    transition: var(--transition-smooth);
}

textarea::placeholder {
    color: var(--gray-text);
    opacity: 0.7;
}

.char-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 0.85rem;
    color: var(--gray-text);
    background: rgba(10, 10, 10, 0.7);
    padding: 3px 8px;
    border-radius: 10px;
    pointer-events: none;
}

/* Glyph Button */
.glyph-btn {
    position: relative;
    background: transparent;
    border: none;
    outline: none;
    padding: 1rem 2.5rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--light-text);
    cursor: pointer;
    border-radius: 50px;
    overflow: hidden;
    transition: var(--transition-smooth);
    z-index: 1;
}

.btn-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--primary-dark), var(--primary-color), var(--primary-light));
    background-size: 200% 200%;
    z-index: -1;
    transition: var(--transition-smooth);
    border-radius: 50px;
    animation: gradient-shift 5s ease infinite;
}

.glyph-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--primary-color));
    background-size: 300% 300%;
    z-index: -2;
    border-radius: 50px;
    animation: border-rotate 3s linear infinite;
}

.glyph-btn:hover .btn-bg {
    opacity: 0.9;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.6);
}

.glyph-btn:active .btn-bg {
    transform: scale(0.98);
}

.btn-text {
    transition: var(--transition-smooth);
    position: relative;
    z-index: 2;
}

.btn-emoji {
    margin-left: 10px;
    opacity: 0.8;
    transition: var(--transition-smooth);
    position: relative;
    z-index: 2;
}

.glyph-btn:hover .btn-emoji {
    opacity: 1;
    animation: float 1s ease infinite;
}

/* Output Section */
.output-section {
    width: 100%;
    max-width: 800px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.output-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.output-section.hidden {
    display: none;
}

.output-container {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(138, 43, 226, 0.2);
    position: relative;
    overflow: hidden;
}

.output-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    background: linear-gradient(45deg, transparent, var(--secondary-color), transparent);
    z-index: -1;
    animation: border-glow 3s linear infinite alternate;
    border-radius: 15px;
    opacity: 0.5;
}

.output-container h2 {
    font-family: 'Orbitron', sans-serif;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.8rem;
}

.output-text-container {
    position: relative;
    background: rgba(10, 10, 10, 0.5);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 255, 255, 0.1);
}

.output-text {
    min-height: 100px;
    line-height: 1.6;
    font-size: 1.1rem;
    word-break: break-word;
    color: var(--light-text);
    font-family: monospace;
    white-space: pre-wrap;
}

.glyph-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.glyph-char.reveal {
    opacity: 1;
    transform: translateY(0);
}

.glyph-char.highlight {
    color: var(--secondary-color);
    text-shadow: 0 0 5px var(--secondary-color);
}

.output-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.conversion-info {
    font-size: 0.8rem;
    color: var(--gray-text);
    margin-top: 0.8rem;
    text-align: right;
    opacity: 0;
    transition: opacity 0.5s ease;
    font-style: italic;
}

.action-btn {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: var(--light-text);
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: 'Roboto', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn i {
    font-size: 0.9rem;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.9);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#loading-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

#loading-overlay.hidden {
    display: none;
}

.magic-circle {
    width: 150px;
    height: 150px;
    position: relative;
    margin-bottom: 2rem;
}

.magic-circle-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: rotate 5s linear infinite;
}

.magic-circle-inner::before,
.magic-circle-inner::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px dashed var(--secondary-color);
    border-radius: 50%;
    opacity: 0.5;
}

.magic-circle-inner::before {
    animation: rotate-reverse 10s linear infinite;
}

.magic-circle-inner::after {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    animation: rotate 7s linear infinite;
}

.magic-rune {
    position: absolute;
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--primary-color);
    transform-origin: center;
}

.magic-rune:nth-child(1) {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    animation: pulse 2s ease infinite;
}

.magic-rune:nth-child(2) {
    bottom: 0;
    left: 20%;
    animation: pulse 2s ease infinite 0.3s;
}

.magic-rune:nth-child(3) {
    bottom: 0;
    right: 20%;
    animation: pulse 2s ease infinite 0.6s;
}

.loading-text {
    font-family: 'Orbitron', sans-serif;
    color: var(--light-text);
    font-size: 1.2rem;
    text-align: center;
    letter-spacing: 1px;
    animation: pulse-text 2s ease infinite;
}

/* Toast Container */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

/* Magic Cursor (more subtle) */
#magic-cursor {
    position: fixed;
    width: 24px; /* Smaller */
    height: 24px; /* Smaller */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%238a2be2"><path d="M7 4a.5.5 0 0 0-.5.5v15a.5.5 0 0 0 .854.354l7.146-7.146a.5.5 0 0 0 0-.708L7.354 4.854A.5.5 0 0 0 7 4z"/></svg>');
    background-size: contain;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transform: translate(-50%, -50%) rotate(45deg);
    transition: opacity 0.3s;
    filter: opacity(0.6); /* More transparent */
}

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    padding: 1rem 0;
    color: var(--gray-text);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .floating-input {
        max-width: 100%;
    }
    
    textarea {
        font-size: 1rem;
        padding: 1rem;
    }
    
    .glyph-btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    
    .output-container {
        padding: 1.5rem;
    }
    
    .output-container h2 {
        font-size: 1.5rem;
    }
    
    .output-text {
        font-size: 1rem;
    }
    
    .magic-circle {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }
    
    .output-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-btn {
        justify-content: center;
    }
}

/* Animation Keyframes */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes border-rotate {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

@keyframes border-glow {
    0% {
        opacity: 0.2;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 0.2;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes rotate-reverse {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(-360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translateX(-50%) scale(1.2);
        opacity: 1;
    }
}

@keyframes pulse-text {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

/* Enhanced Responsive Design */

/* Medium screens (tablets) */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    textarea {
        font-size: 1rem;
        padding: 1rem;
    }
    
    .glyph-btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    
    .output-container h2 {
        font-size: 1.5rem;
    }
    
    .output-text {
        font-size: 1rem;
    }
    
    .char-counter {
        font-size: 0.8rem;
    }
    
    .action-btn {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    .loading-text {
        font-size: 1.1rem;
    }
}

/* Small screens (large phones) */
@media (max-width: 576px) {
    h1 {
        font-size: 2.2rem;
    }
    
    .tagline {
        font-size: 0.9rem;
    }
    
    textarea {
        font-size: 0.95rem;
        min-height: 120px;
        padding: 0.9rem;
    }
    
    .glyph-btn {
        padding: 0.7rem 1.8rem;
        font-size: 0.95rem;
    }
    
    .output-container h2 {
        font-size: 1.3rem;
    }
    
    .output-text {
        font-size: 0.95rem;
        min-height: 80px;
    }
    
    .action-btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.7rem;
    }
    
    .loading-text {
        font-size: 1rem;
    }
    
    .char-counter {
        font-size: 0.75rem;
        padding: 2px 6px;
    }
    
    .output-text-container {
        padding: 1.2rem;
    }
    
    .conversion-info {
        font-size: 0.75rem;
    }
}

/* Extra small screens (small phones) */
@media (max-width: 480px) {
    .container {
        padding: 0.8rem;
    }
    
    h1 {
        font-size: 1.9rem;
    }
    
    .tagline {
        font-size: 0.85rem;
        margin-top: 0.8rem;
    }
    
    textarea {
        font-size: 0.9rem;
        min-height: 100px;
        padding: 0.8rem;
    }
    
    .glyph-btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .output-container {
        padding: 1.2rem;
    }
    
    .output-container h2 {
        font-size: 1.2rem;
        margin-bottom: 1.2rem;
    }
    
    .output-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .output-text-container {
        padding: 1rem;
        margin-bottom: 1.2rem;
    }
    
    .action-btn {
        font-size: 0.8rem;
        padding: 0.35rem 0.6rem;
    }
    
    .loading-text {
        font-size: 0.9rem;
    }
    
    .magic-circle {
        width: 100px;
        height: 100px;
    }
    
    footer {
        font-size: 0.8rem;
        margin-top: 2rem;
    }
}

/* Very small screens (very small phones) */
@media (max-width: 360px) {
    h1 {
        font-size: 1.7rem;
    }
    
    .tagline {
        font-size: 0.8rem;
    }
    
    textarea {
        font-size: 0.85rem;
        padding: 0.7rem;
    }
    
    .glyph-btn {
        padding: 0.5rem 1.3rem;
        font-size: 0.85rem;
    }
    
    .output-container h2 {
        font-size: 1.1rem;
    }
    
    .output-text {
        font-size: 0.85rem;
    }
    
    .char-counter {
        font-size: 0.7rem;
    }
    
    .loading-text {
        font-size: 0.85rem;
    }
}

/* Extremely small screens */
@media (max-width: 320px) {
    h1 {
        font-size: 1.5rem;
    }
    
    .tagline {
        font-size: 0.75rem;
    }
    
    textarea {
        font-size: 0.8rem;
        padding: 0.6rem;
    }
    
    .glyph-btn {
        padding: 0.5rem 1.2rem;
        font-size: 0.8rem;
    }
    
    .output-container h2 {
        font-size: 1rem;
    }
    
    .output-text {
        font-size: 0.8rem;
    }
    
    .action-btn {
        font-size: 0.75rem;
    }
    
    .loading-text {
        font-size: 0.8rem;
    }
    
    .magic-circle {
        width: 80px;
        height: 80px;
    }
}

/* For the smallest screens */
@media (max-width: 300px) {
    h1 {
        font-size: 1.4rem;
        letter-spacing: 1px;
    }
    
    .tagline {
        font-size: 0.7rem;
    }
    
    textarea {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
    
    .glyph-btn {
        padding: 0.4rem 1rem;
        font-size: 0.75rem;
    }
    
    .output-container h2 {
        font-size: 0.9rem;
    }
    
    .output-text {
        font-size: 0.75rem;
    }
    
    .char-counter {
        font-size: 0.65rem;
        padding: 2px 4px;
    }
    
    .action-btn {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }
    
    .loading-text {
        font-size: 0.75rem;
    }
}

.btn-text { text-shadow: 0px 0px 10px black, 0px 0px 5px black, 0px 0px 2px black, 1px 1px black, -1px -1px black; }