/* Base Styles */
body {
   font-family: Arial, sans-serif;
   background-color: #08041C;
   margin: 0;
   padding: 20px;
   color: #ffffff;
   box-sizing: border-box;
}

/* Logo Container */
.logo-container {
   text-align: center;
   margin: 20px 0;
}

.logo {
   max-width: 250px;
   height: auto;
}

/* Category Navigation */
.category-container {
   display: flex;
   justify-content: center;
   gap: 15px;
   margin-bottom: 20px;
   flex-wrap: wrap;
}

.category-btn {
   padding: 8px 16px;
   border: none;
   background: linear-gradient(to right, #6a11cb, #2575fc);
   color: #fff;
   border-radius: 15px;
   cursor: pointer;
   font-size: 14px;
   transition: background 0.3s ease;
}

.category-btn:hover, 
.category-btn.active {
   background: linear-gradient(to right, #2575fc, #6a11cb);
}

/* Search Container */
.search-container {
   display: flex;
   justify-content: center;
   margin: 20px auto 40px;
   width: 100%;
   max-width: 600px;
}

.search-wrapper {
   display: flex;
   width: 100%;
   position: relative;
   align-items: center;
   background: rgba(255, 255, 255, 0.1);
   border-radius: 30px;
   padding: 5px;
   transition: all 0.3s ease;
}

.search-wrapper:hover {
   background: rgba(255, 255, 255, 0.15);
}

.search-input {
   width: 100%;
   padding: 15px 20px;
   border: none;
   border-radius: 25px;
   background: transparent;
   color: white;
   font-size: 16px;
   transition: all 0.3s ease;
}

.search-input:focus {
   outline: none;
}

.search-input::placeholder {
   color: rgba(255, 255, 255, 0.6);
   font-size: 16px;
}

.search-button {
   position: absolute;
   right: 5px;
   padding: 12px 20px;
   border: none;
   border-radius: 25px;
   background: linear-gradient(to right, #6a11cb, #2575fc);
   color: white;
   cursor: pointer;
   transition: all 0.3s ease;
}

.search-button:hover {
   background: linear-gradient(to right, #2575fc, #6a11cb);
   transform: scale(1.05);
}

/* Cards Container */
.cards-container {
   display: grid;
   grid-template-columns: repeat(4, 1fr);
   gap: 20px;
   width: 100%;
   max-width: 1200px;
   margin: 0 auto;
   padding: 0 20px;
   box-sizing: border-box;
}

/* Card Styles */
.card {
   background: #1c1c3c;
   border-radius: 8px;
   cursor: pointer;
   transition: all 0.3s ease;
   position: relative;
   overflow: hidden;
}

.card-content {
   padding: 15px;
   position: relative;
   z-index: 1;
}

.card::before {
   content: '';
   position: absolute;
   top: 0;
   right: 0;
   bottom: 0;
   left: 0;
   background: linear-gradient(to right, #6a11cb, #2575fc);
   opacity: 0.3;
   transition: opacity 0.3s ease;
}

.card::after {
   content: '';
   position: absolute;
   top: 1px;
   right: 1px;
   bottom: 1px;
   left: 1px;
   background: #1c1c3c;
   border-radius: 7px;
   z-index: 0;
}

.card:hover::before {
   opacity: 1;
}

.card:hover {
   transform: scale(1.03);
}

.card-icon {
   font-size: 35px;
   color: #6a11cb;
   margin: 10px 0;
   position: relative;
   z-index: 1;
}

.card h3 {
   color: #ffffff;
   margin: 10px 0;
   font-size: 18px;
   position: relative;
   z-index: 1;
}

.card p {
   color: #cccccc;
   font-size: 14px;
   line-height: 1.4;
   margin-bottom: 10px;
   position: relative;
   z-index: 1;
}

/* Favorite Button */
.favorite-btn {
   border: none;
   background: none;
   font-size: 20px;
   cursor: pointer;
   color: #ccc;
   transition: color 0.3s ease;
   position: absolute;
   top: 10px;
   right: 10px;
   z-index: 2;
}

.favorite-btn.favorited {
   color: gold;
}
/* Modal Styles */
.modal {
   display: none;
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background: rgba(8, 4, 28, 0.9);
   z-index: 1000;
   opacity: 0;
   transition: opacity 0.3s ease;
}

.modal.active {
   display: flex;
   opacity: 1;
}

.modal-content {
   background: #1c1c3c;
   border-radius: 12px;
   width: 90%;
   max-width: 800px;
   margin: auto;
   position: relative;
   transform: translateY(-20px);
   transition: transform 0.3s ease;
   box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
   border: 1px solid rgba(106, 17, 203, 0.2);
}

.modal.active .modal-content {
   transform: translateY(0);
}

.modal-header {
   padding: 20px 30px;
   border-bottom: 1px solid rgba(106, 17, 203, 0.2);
   display: flex;
   justify-content: space-between;
   align-items: center;
   margin-bottom: 10px;
}

.modal-header h2 {
   color: white;
   margin: 0;
   font-size: 24px;
}

.modal-close {
   background: none;
   border: none;
   color: #fff;
   font-size: 28px;
   cursor: pointer;
   transition: transform 0.3s ease;
   padding: 5px;
}

.modal-close:hover {
   transform: scale(1.1);
   color: #6a11cb;
}

.modal-body {
   padding: 30px;
   max-height: 80vh;
   overflow-y: auto;
}

/* Form Styles */
.template-form {
   display: flex;
   flex-direction: column;
   gap: 20px;
}

.template-fields {
   display: none;
   flex-direction: column;
   gap: 32px;
   padding: 20px 0;
   margin-bottom: 20px;
}

.template-fields.active {
   display: flex;
}

.form-group {
   display: flex;
   flex-direction: column;
   gap: 12px;
   margin-bottom: 8px;
   margin-top: 24px;
}

.form-group label {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
    display: block;
    width: 100%;
}

.form-group input {
    padding: 12px 15px;
    border: 1px solid rgba(106, 17, 203, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #cccccc; /* Color más claro para el texto de input */
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus {
   outline: none;
   border-color: #6a11cb;
   background: rgba(255, 255, 255, 0.1);
}

.form-group input::placeholder {
   color: rgba(255, 255, 255, 0.3);
}

/* Generate Button and Loading States */
.generate-container {
   display: flex;
   flex-direction: column;
   align-items: center;
   gap: 10px;
   margin-top: 20px;
   margin-bottom: 20px;
}

.generate-btn {
   width: 100%;
   padding: 0;
   border: none;
   border-radius: 8px;
   background: linear-gradient(to right, #6a11cb, #2575fc);
   cursor: pointer;
   transition: all 0.3s ease;
}

.generate-btn:hover {
   transform: scale(1.02);
}

.generate-content {
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 10px;
   padding: 12px 24px;
   color: white;
   font-size: 16px;
}

.btn-loader, 
.thinking-loader {
   display: none;
   width: 20px;
   height: 20px;
   border: 2px solid #ffffff;
   border-radius: 50%;
   border-top-color: transparent;
   animation: spin 1s linear infinite;
}

.thinking-message {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: rgba(106, 17, 203, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(106, 17, 203, 0.2);
}

.thinking-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.step-item.active {
    opacity: 1;
}

.step-icon {
    font-size: 24px;
    min-width: 24px;
}

.step-text {
    font-size: 14px;
    color: white;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #6a11cb, #2575fc);
    transition: width 0.5s ease;
}

/* Result Area */
.result-area {
   margin-top: 15px;
}

.result-header-compact {
   text-align: center;
   margin-bottom: 15px;
}

.result-header-compact h3 {
   color: white;
   margin: 0;
}

.action-buttons-top {
   display: flex;
   justify-content: center;
   gap: 10px;
   margin-bottom: 15px;
}

.compact-toolbar {
   background: #1c1c3c;
   padding: 8px;
   border-radius: 8px;
   display: flex;
   justify-content: center;
   gap: 5px;
   margin-bottom: 15px;
}

.compact-toolbar button {
   padding: 6px 10px;
   border: none;
   border-radius: 4px;
   background: rgba(255, 255, 255, 0.1);
   color: white;
   cursor: pointer;
   font-size: 14px;
   transition: background 0.2s;
}

.compact-toolbar button:hover {
   background: rgba(255, 255, 255, 0.2);
}

.result-content {
   margin-bottom: 20px;
}

.result-text {
   background: white;
   color: black;
   padding: 30px;
   border-radius: 8px;
   min-height: 600px;
   max-height: 800px;
   overflow-y: auto;
   width: 100%;
   box-sizing: border-box;
   white-space: pre-wrap;
   line-height: 1.6;
   font-size: 16px;
}

.result-text div,
.result-text p {
   margin-bottom: 1.2em;
}

.result-text:focus {
   outline: none;
}

.action-btn {
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 8px;
   padding: 10px 20px;
   border: none;
   border-radius: 8px;
   cursor: pointer;
   font-size: 14px;
   transition: all 0.3s ease;
   min-width: 120px;
}

.action-btn .btn-icon {
   font-size: 18px;
}

.copy-btn {
   background: linear-gradient(to right, #6a11cb, #2575fc);
   color: white;
}

.whatsapp-btn {
   background: linear-gradient(to right, #25d366, #128C7E) !important;
}

.whatsapp-btn:hover {
   background: linear-gradient(to right, #128C7E, #25d366) !important;
   transform: scale(1.05);
}

.copy-btn:hover {
   background: linear-gradient(to right, #2575fc, #6a11cb);
   transform: scale(1.05);
}

.regenerate-btn {
   background: #2d2d5b;
   color: white;
   border: 1px solid rgba(106, 17, 203, 0.3);
}

.regenerate-btn:hover {
   background: #3d3d6b;
   transform: scale(1.05);
}

/* Animations */
@keyframes spin {
   to {
       transform: rotate(360deg);
   }
}

/* Responsive Styles */
@media (max-width: 1200px) {
   .cards-container {
       grid-template-columns: repeat(3, 1fr);
       max-width: 900px;
   }
}

@media (max-width: 900px) {
   .cards-container {
       grid-template-columns: repeat(2, 1fr);
       max-width: 600px;
   }
}

@media (max-width: 600px) {
   .cards-container {
       grid-template-columns: 1fr;
       max-width: 300px;
   }

   .modal-content {
       width: 95%;
       margin: 20px auto;
   }

   .modal-header, 
   .modal-body {
       padding: 15px;
   }

   .action-buttons-top {
       flex-direction: column;
       gap: 10px;
   }

   .action-btn {
       width: 100%;
       font-size: 14px;
       padding: 8px 12px;
       min-width: auto;
       display: flex;
       justify-content: center;
       align-items: center;
   }

   .action-btn .btn-icon {
       font-size: 16px;
   }

   .btn-text {
       display: inline-block !important;
       margin-left: 8px;
   }

   .thinking-message {
       padding: 15px;
   }

   .step-text {
       font-size: 13px;
   }

   .step-icon {
       font-size: 20px;
       min-width: 20px;
   }

   .form-group {
       gap: 8px;
   }


   .form-group input {
       font-size: 14px;
       padding: 10px 12px;
   }

   .generate-btn {
       padding: 10px 15px;
   }

   .category-container {
       padding: 0 10px;
   }

   .category-btn {
       font-size: 13px;
       padding: 6px 12px;
   }

   .search-input {
       font-size: 14px;
       padding: 12px 15px;
   }

   .search-button {
       padding: 10px 15px;
   }

   .compact-toolbar {
       flex-wrap: wrap;
   }

   .compact-toolbar button {
       padding: 5px 8px;
       font-size: 13px;
   }

   .result-text {
       font-size: 14px;
       padding: 15px;
       min-height: 400px;
   }
}

/* Fix for mobile buttons text */
@media (max-width: 600px) {
   .action-btn .btn-text {
       display: inline-block !important;
       margin-left: 8px;
       font-size: 14px;
   }
}
[data-format="underline"] {
    text-decoration: underline;
}

.emoji-picker-container {
    position: fixed;
    z-index: 9999;
    background: #1c1c3c;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.emoji-mart {
    font-family: Arial, sans-serif;
}

.emoji-mart-search {
    padding: 10px;
}

.emoji-mart-category-label {
    padding: 5px 10px;
    font-weight: bold;
}

.emoji-mart-scroll {
    max-height: 300px;
}

.clear-fields-btn {
    padding: 8px 16px;
    background: #2d2d5b;
    color: white;
    border: 1px solid rgba(106, 17, 203, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
    width: auto;
}

.clear-fields-btn:hover {
    background: #3d3d6b;
}