/* Tool Page Specific Styles */

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 40px;
}

.tool-title {
    font-size: 42px;
    font-weight: 700;
    color: #000;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.tool-subtitle {
    font-size: 20px;
    color: #666;
    margin-bottom: 20px;
}

.back-link {
    color: #0066cc;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

/* Input Section */
.input-section {
    margin-bottom: 40px;
}

.input-container {
    background-color: #f8f9fa;
    padding: 40px;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    max-width: 800px;
    margin: 0 auto;
}

.input-container h2 {
    font-size: 28px;
    font-weight: 600;
    color: #000;
    margin-bottom: 10px;
    text-align: center;
}

.input-container p {
    font-size: 16px;
    color: #555;
    margin-bottom: 30px;
    text-align: center;
}

.url-input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.url-input {
    flex: 1;
    min-width: 300px;
    padding: 16px 20px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.url-input:focus {
    outline: none;
    border-color: #000;
}

.analyze-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #000;
    color: #fff;
    padding: 16px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.analyze-button:hover {
    background-color: #333;
    transform: translateY(-1px);
}

.analyze-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.input-help {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #0066cc;
}

.input-help p {
    margin: 0;
    font-size: 14px;
    color: #555;
    text-align: left;
}

/* Analysis Tabs */
.analysis-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e5e5e5;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background-color: transparent;
    color: #666;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #000;
    border-bottom-color: #000;
}

.tab-btn:hover {
    color: #000;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Image Upload */
.image-upload-container {
    margin-top: 20px;
}

.image-upload-area {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.image-upload-area:hover {
    border-color: #000;
    background-color: #f0f0f0;
}

.image-upload-area.dragover {
    border-color: #000;
    background-color: #e8f4fd;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.image-upload-area p {
    margin: 5px 0;
    font-size: 16px;
    color: #555;
}

.upload-hint {
    font-size: 14px !important;
    color: #888 !important;
}

.image-preview {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
}

.image-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    object-fit: cover;
}

.image-info {
    flex: 1;
}

.image-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #555;
}

.remove-btn {
    padding: 8px 16px;
    background-color: #dc3545;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background-color: #c82333;
}

/* Text Input */
.text-input-container {
    margin-top: 20px;
}

.text-input {
    width: 100%;
    min-height: 200px;
    padding: 20px;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    font-size: 16px;
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    background-color: #fff;
}

.text-input:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.text-input::placeholder {
    color: #999;
    font-style: italic;
}

.text-input-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    padding: 0 5px;
}

.text-hint {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.text-counter {
    font-size: 14px;
    color: #999;
    margin: 0;
    font-weight: 500;
}

.text-counter span {
    color: #000;
    font-weight: 600;
}

/* Loading Section */
.loading-section {
    margin-bottom: 40px;
}

.loading-container {
    text-align: center;
    padding: 60px 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e5e5;
    border-top: 4px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-container h3 {
    font-size: 24px;
    font-weight: 600;
    color: #000;
    margin-bottom: 10px;
}

.loading-container p {
    font-size: 16px;
    color: #555;
}

/* MAGIC Progress Animation */
.magic-progress {
    margin-top: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
}

.magic-progress-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 18px;
    font-weight: 600;
    color: #dc3545;
    animation: fadeInOut 3s ease-in-out infinite;
}

.magic-letter {
    font-size: 32px;
    font-weight: 700;
    color: #000;
    background-color: #fff;
    border: 2px solid #dc3545;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
}

.magic-description {
    color: #dc3545;
    font-weight: 600;
}

@keyframes fadeInOut {
    0%, 100% { 
        opacity: 0.3; 
        transform: scale(0.95);
    }
    50% { 
        opacity: 1; 
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
}

/* MAGIC Letter Score Colors */
.magic-letter.score-0 {
    background-color: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.magic-letter.score-1 {
    background-color: #ffc107;
    color: #000;
    border-color: #ffc107;
}

.magic-letter.score-2 {
    background-color: #28a745;
    color: #fff;
    border-color: #28a745;
    animation: flash-green 1.5s ease-in-out infinite;
}

@keyframes flash-green {
    0%, 100% {
        background-color: #28a745;
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    50% {
        background-color: #20c997;
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
}

/* MAGIC Color Key */
.magic-color-key {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0 25px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    flex-wrap: wrap;
}

.color-key-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-key-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid;
    flex-shrink: 0;
}

.color-key-indicator.score-0 {
    background-color: #dc3545;
    border-color: #dc3545;
}

.color-key-indicator.score-1 {
    background-color: #ffc107;
    border-color: #ffc107;
}

.color-key-indicator.score-2 {
    background-color: #28a745;
    border-color: #28a745;
    animation: flash-green 1.5s ease-in-out infinite;
}

.color-key-text {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Results Section */
.results-section {
    margin-bottom: 40px;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.result-card {
    background-color: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.result-card h3 {
    font-size: 24px;
    font-weight: 600;
    color: #000;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.result-content {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
}

/* MAGIC Analysis */
.magic-analysis {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.magic-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 25px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #000;
}

.magic-letter {
    font-size: 36px;
    font-weight: 700;
    color: #000;
    min-width: 50px;
    text-align: center;
}

.magic-content h4 {
    font-size: 20px;
    font-weight: 600;
    color: #000;
    margin-bottom: 10px;
}

.analysis-text {
    font-size: 16px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 15px;
}

.magic-score {
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-label {
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

.score-value {
    font-size: 18px;
    font-weight: 700;
    color: #000;
    background-color: #f0f0f0;
    padding: 4px 12px;
    border-radius: 20px;
    min-width: 30px;
    text-align: center;
}

/* Rating Card */
.rating-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #000;
}

.rating-container {
    text-align: center;
}

.total-score {
    font-size: 48px;
    font-weight: 700;
    color: #000;
    margin-bottom: 10px;
}

.score-out-of {
    font-size: 24px;
    color: #666;
}

.rating-text {
    font-size: 24px;
    font-weight: 600;
    color: #000;
    margin-bottom: 10px;
}

.rating-description {
    font-size: 16px;
    color: #555;
    max-width: 400px;
    margin: 0 auto;
}

/* Rating Card */
.rating-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #000;
}

/* Conservative Assessment */
.assessment-content {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #0066cc;
}

/* Biblical Alignment */
.biblical-content {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    background-color: #fff5f5;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #e53e3e;
}

/* Red Flags */
.red-flags-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.red-flag-item {
    padding: 15px 20px;
    background-color: #fff5f5;
    border-left: 4px solid #e53e3e;
    border-radius: 8px;
    font-size: 16px;
    color: #555;
    font-weight: 500;
}

/* Search Operators */
.search-operators-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-operator {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    border-left: 4px solid #0066cc;
    transition: all 0.3s ease;
}

.search-operator:hover {
    border-left-color: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-operator h4 {
    font-size: 18px;
    font-weight: 600;
    color: #000;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-operator h4::before {
    content: '🔍';
    font-size: 16px;
}

.search-operator code {
    background-color: #000;
    color: #fff;
    padding: 12px 16px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    display: block;
    margin-bottom: 15px;
    word-break: break-all;
    line-height: 1.4;
    white-space: pre-wrap;
}

.search-operator p {
    font-size: 15px;
    color: #555;
    margin-bottom: 10px;
    line-height: 1.5;
}

.search-operator p:last-child {
    margin-bottom: 0;
}

.search-operator strong {
    color: #000;
    font-weight: 600;
}

/* Search Query Container */
.search-query-container {
    position: relative;
    margin-bottom: 15px;
}

.search-operator code {
    background-color: #000;
    color: #fff;
    padding: 12px 16px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    display: block;
    word-break: break-all;
    line-height: 1.4;
    white-space: pre-wrap;
    padding-right: 120px; /* Space for buttons */
}

.search-buttons {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 8px;
}

.copy-btn, .search-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.copy-btn {
    background-color: #6c757d;
    color: #fff;
}

.copy-btn:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.search-btn {
    background-color: #007bff;
    color: #fff;
}

.search-btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

/* Content Headline Section */
.content-headline {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px;
    border-radius: 12px;
    border-left: 5px solid #000;
    margin-bottom: 30px;
    text-align: center;
}

.content-headline h3 {
    font-size: 28px;
    font-weight: 700;
    color: #000;
    margin-bottom: 10px;
    line-height: 1.3;
}

.headline-subtext {
    font-size: 16px;
    color: #666;
    margin: 0;
    font-style: italic;
}

/* Refresh Section */
.refresh-section {
    text-align: center;
    margin-top: 40px;
    padding: 30px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.refresh-button {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.refresh-button:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

.refresh-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.refresh-button .button-icon {
    font-size: 18px;
}

.refresh-button .button-text {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.tool-link {
    padding: 12px 20px;
    background-color: #f0f0f0;
    color: #0066cc;
    text-decoration: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tool-link:hover {
    background-color: #000;
    color: #fff;
}

/* Error Section */
.error-section {
    margin-bottom: 40px;
}

.error-container {
    background-color: #fff5f5;
    border: 1px solid #e53e3e;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.error-container h3 {
    font-size: 24px;
    font-weight: 600;
    color: #e53e3e;
    margin-bottom: 15px;
}

.error-container p {
    font-size: 16px;
    color: #555;
    margin-bottom: 25px;
}

.retry-button {
    background-color: #e53e3e;
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-button:hover {
    background-color: #c53030;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-title {
        font-size: 32px;
    }

    .tool-subtitle {
        font-size: 18px;
    }

    .input-container {
        padding: 30px 20px;
    }

    .input-container h2 {
        font-size: 24px;
    }

    .url-input-group {
        flex-direction: column;
    }

    .url-input {
        min-width: auto;
    }

    .analyze-button {
        justify-content: center;
    }

    .magic-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .magic-letter {
        font-size: 32px;
        min-width: auto;
    }

    .total-score {
        font-size: 36px;
    }

    .score-out-of {
        font-size: 20px;
    }

    .rating-text {
        font-size: 20px;
    }

    .verification-tools {
        justify-content: center;
    }

    /* Search operator buttons on mobile */
    .search-operator code {
        padding-right: 8px;
        margin-bottom: 10px;
    }

    .search-buttons {
        position: static;
        justify-content: center;
        margin-top: 10px;
    }

    .copy-btn, .search-btn {
        flex: 1;
        max-width: 120px;
    }

    /* Image upload on mobile */
    .image-preview {
        flex-direction: column;
        text-align: center;
    }

    .image-preview img {
        max-width: 100%;
        max-height: 200px;
    }

    .image-info {
        margin: 15px 0;
    }

    .analysis-tabs {
        flex-direction: column;
        gap: 5px;
    }

    .tab-btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    /* Content headline on mobile */
    .content-headline {
        padding: 20px;
        margin-bottom: 20px;
    }

    .content-headline h3 {
        font-size: 24px;
    }

    .headline-subtext {
        font-size: 14px;
    }

    /* Refresh button on mobile */
    .refresh-section {
        padding: 20px;
        margin-top: 30px;
    }

    .refresh-button {
        padding: 12px 24px;
        font-size: 14px;
    }

    /* MAGIC progress on mobile */
    .magic-progress-text {
        flex-direction: column;
        gap: 10px;
    }

    .magic-letter {
        font-size: 28px;
        width: 45px;
        height: 45px;
    }

    .magic-description {
        font-size: 16px;
    }

    /* Text input on mobile */
    .text-input {
        min-height: 150px;
        padding: 15px;
        font-size: 16px;
    }

    .text-input-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .text-hint, .text-counter {
        font-size: 13px;
    }

    /* Color key on mobile */
    .magic-color-key {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }

    .color-key-item {
        justify-content: center;
    }

    .color-key-text {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .tool-title {
        font-size: 28px;
    }

    .input-container {
        padding: 20px 15px;
    }

    .result-card {
        padding: 20px 15px;
    }

    .magic-item {
        padding: 20px 15px;
    }

    .total-score {
        font-size: 32px;
    }
}
