/*
 * Styles for the Tools Showcase Page
 */

/* Main Grid for Tool Cards */
.tools-showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    justify-content: center;
    justify-items: center;
}

/* The section containing the tools grid will now follow the default alternating background */
.tools-grid-section {
    
}

/* Individual Tool Card */
.tool-card-showcase {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    width: 100%;
    max-width: 360px;
}
.tool-card-showcase:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.tool-card-content {
    padding: 4rem 2.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tool-card-content h2 {
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
    line-height: 1.3;
    min-height: 2.6em; /* Accommodates two lines of text to align content below */
    text-align: center;
}

.tool-card-content > p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-color-light);
    flex-grow: 1;
}

/* Features List inside the card */
.tool-card-features {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.tool-card-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}
.tool-card-features i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

/* Action Buttons inside the card */
.tool-card-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}
.tool-card-actions a {
    flex: 1;
}
.tool-card-actions .btn {
    text-align: center;
    justify-content: center;
}

/* Override for the secondary 'Details' button on tool cards */
.tool-card-actions .btn-secondary {
    background-color: var(--light-gray);
    color: var(--text-color);
    border: 3px solid var(--primary-color);
}

.tool-card-actions .btn-secondary:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Help Section */
.help-section-detailed {
    background-color: #f0f0f0;
    scroll-margin-top: 110px;
}
.help-grid-detailed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    text-align: left;
}
.help-article-detailed {
    background-color: var(--light-gray);
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    scroll-margin-top: 110px;
}
.help-article-detailed h3 {
    font-size: 1.3rem;
    margin: 0 0 1.5rem;
    text-align: center;
}

.tool-card-content h2 i,
.help-article-detailed h3 i {
    margin-right: 0.3em;
}

.help-steps-detailed {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.help-step-detailed {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.help-step-number-detailed {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--header-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}
.help-step-content-detailed h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}
.help-step-content-detailed p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-color-light);
    margin: 0;
}
.help-step-content-detailed code {
    background-color: #e9ecef;
    padding: 0.1em 0.4em;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.85rem;
}

/* Suggestion Box Styles */
.suggestion-box {
    position: relative;
}

.suggestion-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 1010;
    transition: transform 0.2s ease, background-color 0.2s ease;
    overflow: visible;
}

.suggestion-fab:hover {
    transform: scale(1.1);
    background-color: #b197f1;
}

.suggestion-fab .icon-close,
.suggestion-fab .icon-open {
    position: relative;
    z-index: 2;
}
.suggestion-fab .icon-close { display: none; }
.suggestion-fab .icon-open { display: block; }
.suggestion-fab.active .icon-close { display: block; }
.suggestion-fab.active .icon-open { display: none; }


@keyframes pulse-animation {
  0% { box-shadow: 0 0 0 0 rgba(158, 120, 232, 0.7); }
  70% { box-shadow: 0 0 0 20px rgba(158, 120, 232, 0); }
  100% { box-shadow: 0 0 0 0 rgba(158, 120, 232, 0); }
}
.suggestion-fab.pulse {
  animation: pulse-animation 2s infinite;
}

.suggestion-dialog {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    max-width: calc(100vw - 40px);
    background-color: var(--bg-color);
    border: 2px solid var(--primary-color);
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 1009;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0.5);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    pointer-events: none;
}

.suggestion-dialog.active {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

.suggestion-dialog-content {
    padding: 1.5rem;
    position: relative;
}

.suggestion-dialog h3 {
    font-size: 1.2rem;
    margin: 0 0 0.5rem;
}

.suggestion-dialog h3 i {
    margin-right: 0.5rem;
}

.suggestion-dialog p {
    font-size: 0.9rem;
    color: var(--text-color-light);
    margin-bottom: 1.5rem;
}

.suggestion-dialog .form-group {
    margin-bottom: 1rem;
}
.suggestion-dialog .form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.25rem;
}
.suggestion-dialog .form-group textarea,
.suggestion-dialog .form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-family: inherit;
}
.suggestion-dialog .form-group textarea {
    resize: none;
}
.suggestion-dialog .btn {
    width: 100%;
}

#successMessage {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-direction: column;
    padding: 1.5rem;
    
    /* for transition */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.95);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

#successMessage.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: scale(1);
}

#successMessage i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

#successMessage h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.form-message {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 24px;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.form-message--error {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

.btn.u-loading {
    position: relative;
}
.btn.u-loading span,
.btn.u-loading i {
    opacity: 0;
}
.btn.u-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.2em;
    height: 1.2em;
    margin-top: -0.6em;
    margin-left: -0.6em;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: var(--header-text);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive Overrides */
@media (max-width: 992px) {
    .tools-showcase-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
    .help-grid-detailed {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .help-section-detailed > .container > h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 420px) {
    .tools-showcase-grid {
        grid-template-columns: 1fr;
    }
    .help-grid-detailed {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .help-article-detailed {
        padding: 1.5rem;
    }
}

/* FAB Emoji Animation */
@keyframes fab-emoji-fly {
    0% {
        transform: translateY(0) scale(0);
        opacity: 0;
    }
    25% {
        transform: translateY(-45px) scale(1);
        opacity: 1;
    }
    50%, 100% {
        transform: translateY(-55px) scale(0.8);
        opacity: 0;
    }
}

.fab-emoji-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.fab-emoji-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: rotate(calc(60deg * var(--i)));
}

.fab-emoji {
    display: block;
    transform-origin: bottom center;
    font-size: 1.2rem;
    opacity: 0;
    animation: fab-emoji-fly 6s ease-out infinite;
    animation-delay: calc(0.2s * var(--i));
}