/**
 * Styles for certificate validation plugin
 *
 * @package    local_certvalidation
 * @copyright  2025 Digital Learning
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */

#page-local-certificate_validation-index{
    /* Force white background for entire page */
    body, #page, #page-content, #region-main, .cert-validation-container {
        background: #fff !important;
        color: #333 !important;
    }

    /* Force all headings and text to be visible */
    h1, h2, h3, h4, h5, h6, p, span, div, label {
        color: #333 !important;
    }

    /* Hide navigation menu for this page */
    .totaraNav_prim--toggleNav,
    .totaraNav_prim--list,
    ul.totaraNav_prim--list,
    .totaraNav_prim--list_item,
    .language-selector,
    #page-header nav,
    .navbar,
    .navbar-fixed-top,
    #nav-drawer,
    .navigation,
    .primary-navigation,
    .secondary-navigation,
    [role="navigation"],
    .totaramenu,
    .navbar-nav,
    .nav-tabs,
    .nav-pills,
    #usernavigation,
    .navbar-collapse,
    header nav,
    header .nav,
    .header-menu,
    .main-navigation,
    nav.navbar,
    .navbar-inner,
    ul.nav,
    .menubar,
    #page-header .navbar,
    #page-header ul.nav,
    #page-header .nav-collapse {
        display: none !important;
        visibility: hidden !important;
    }

    /* Hide "Desarrollado por Totara" footer text */
    .logininfo,
    .homelink,
    footer .logininfo,
    footer .homelink,
    .tool_usertours-resettourcontainer,
    #page-footer .logininfo,
    #page-footer .homelink,
    #page-footer a[href*="totaralearning"],
    #page-footer a[href*="totara.com"],
    #page-footer a[href*="Totara"],
    .footer-content-debugging,
    .footer-powered,
    #page-footer .footer-powered,
    #page-footer .poweredby,
    .poweredby,
    footer .poweredby,
    footer a[href*="totara"],
    #page-footer a[href*="totara"],
    .footer-content a[href*="totara"],
    .footer-links a[href*="totara"],
    #page-footer p,
    #page-footer span,
    .footer-content p,
    .footer-content span,
    footer p:contains("Desarrollado"),
    footer span:contains("Desarrollado") {
        display: none !important;
        visibility: hidden !important;
    }

    /* Hide entire footer content */
    #page-footer .footer-content-debugging,
    #page-footer .footer-content,
    .page-footer-poweredby,
    .page-footer-main-content .page-footer-poweredby {
        display: none !important;
    }

    .cert-validation-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 20px;
        background: #fff !important;
    }

    /* Welcome title styling */
    .cert-welcome-title {
        text-align: center;
        color: #333 !important;
        margin-bottom: 30px;
        font-size: 28px;
        font-weight: 600;
    }

    /* Help icon styling */
    .cert-help-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        background: #4299e1;
        color: white;
        border-radius: 50%;
        font-size: 18px;
        font-weight: bold;
        cursor: pointer;
        margin-left: 10px;
        vertical-align: middle;
        transition: background 0.3s;
        text-decoration: none;
    }

    .cert-help-icon:hover {
        background: #3182ce;
        color: white;
        text-decoration: none;
    }

    /* Modal styling */
    .cert-modal {
        display: none;
        position: fixed;
        z-index: 10000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.7);
        animation: fadeIn 0.3s;
    }

    .cert-modal.active {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .cert-modal-content {
        background-color: #fff;
        padding: 30px;
        border-radius: 12px;
        max-width: 600px;
        width: 90%;
        max-height: 90vh;
        overflow-y: auto;
        position: relative;
        animation: slideIn 0.3s;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    }

    .cert-modal-close {
        position: absolute;
        top: 15px;
        right: 20px;
        font-size: 32px;
        font-weight: bold;
        color: #666;
        cursor: pointer;
        line-height: 1;
        transition: color 0.3s;
    }

    .cert-modal-close:hover {
        color: #333;
    }

    .cert-modal-title {
        color: #333 !important;
        font-size: 24px;
        font-weight: 600;
        margin-bottom: 15px;
        padding-right: 30px;
    }

    .cert-modal-description {
        color: #555 !important;
        font-size: 16px;
        margin-bottom: 20px;
        line-height: 1.6;
    }

    .cert-modal-image {
        width: 100%;
        height: auto;
        border-radius: 8px;
        border: 2px solid #e2e8f0;
        margin-top: 15px;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    @keyframes slideIn {
        from {
            transform: translateY(-50px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .cert-validation-form {
        background: #DCEAF7 !important;
        padding: 30px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        margin-bottom: 30px;
    }

    .cert-validation-form h2 {
        font-size: 26px;
        font-weight: 600;
        margin-bottom: 20px;
        color: #333 !important;
    }

    .cert-form-group {
        margin-bottom: 20px;
    }

    .cert-form-group label {
        display: block;
        margin-bottom: 8px;
        font-weight: 500;
        font-size: 16px;
        color: #333 !important;
    }

    .cert-form-row {
        display: flex;
        gap: 10px;
        align-items: flex-end;
    }

    .cert-form-input-wrapper {
        flex: 1;
    }

    .cert-form-group input[type="text"] {
        width: 100%;
        padding: 12px 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 16px;
        box-sizing: border-box;
    }

    .cert-form-group input[type="text"]:focus {
        outline: none;
        border-color: #4a5568;
    }

    .cert-submit-btn {
        background: #4338ca;
        color: white;
        padding: 12px 30px;
        border: none;
        border-radius: 4px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.3s;
        white-space: nowrap;
    }

    .cert-submit-btn:hover {
        background: #3730a3;
    }

    .cert-result-container {
        background: #dddddd6e !important;
        padding: 30px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .cert-valid-badge {
        display: inline-block;
        background: #10b981;
        color: white !important;
        padding: 10px 24px;
        border-radius: 20px;
        font-size: 20px;
        font-weight: 600;
        margin-bottom: 20px;
    }

    .cert-invalid-badge {
        display: inline-block;
        background: #ef4444;
        color: white !important;
        padding: 10px 24px;
        border-radius: 20px;
        font-size: 20px;
        font-weight: 600;
        margin-bottom: 20px;
    }

    .cert-details {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 30px;
        margin-top: 20px;
        align-items: start;
    }

    .cert-info {
        padding-right: 20px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-height: 100%;
    }

    .cert-info-content {
        flex: 1;
    }

    .cert-info h3 {
        font-size: 24px;
        font-weight: 600;
        margin-bottom: 15px;
        color: #333 !important;
    }

    .cert-info p {
        margin: 10px 0;
        font-size: 17px;
        color: #333 !important;
        line-height: 1.6;
    }

    .cert-info strong {
        color: #333 !important;
        font-weight: 600;
    }

    .cert-image {
        text-align: center;
    }

    .cert-image img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .cert-actions {
        display: flex;
        gap: 15px;
        margin-top: 20px;
    }

    .cert-download-btn {
        background: #4338ca;
        color: white;
        padding: 12px 30px;
        border: none;
        border-radius: 4px;
        font-size: 16px;
        font-weight: 600;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        transition: background 0.3s;
        flex: 1;
        justify-content: center;
    }

    .cert-download-btn:hover {
        background: #3730a3;
        color: white;
        text-decoration: none;
    }
    
    .cert-download-btn svg {
        width: 20px;
        height: 20px;
        stroke: white;
        flex-shrink: 0;
    }
    
    .btn-text-short {
        display: none;
    }
    
    .btn-text-full,
    .btn-text-short {
        color: white !important;
    }

    .cert-linkedin-btn {
        background: #0077b5;
        color: white !important;
        padding: 12px 30px;
        border: none;
        border-radius: 4px;
        font-size: 16px;
        font-weight: 600;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        transition: all 0.3s;
        box-shadow: 0 2px 4px rgba(0, 119, 181, 0.3);
        flex: 1;
        justify-content: center;
    }

    .cert-linkedin-btn:hover {
        background: #006399;
        color: white !important;
        text-decoration: none;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 119, 181, 0.4);
    }
    
    .cert-linkedin-btn svg {
        width: 20px;
        height: 20px;
        fill: white;
        flex-shrink: 0;
    }
    
    .btn-text-full {
        display: inline;
        color: white !important;
    }

    @media (max-width: 768px) {
        /* Reduce font sizes on mobile */
        .cert-welcome-title {
            font-size: 22px;
        }
        
        .cert-validation-form h2 {
            font-size: 20px;
        }
        
        .cert-form-group label {
            font-size: 14px;
        }
        
        .cert-form-group input[type="text"] {
            font-size: 14px;
            padding: 10px 12px;
        }
        
        .cert-submit-btn {
            font-size: 14px;
            padding: 10px 24px;
        }
        
        .cert-valid-badge,
        .cert-invalid-badge {
            font-size: 16px;
            padding: 8px 20px;
            display: block;
            text-align: center;
            margin-left: auto;
            margin-right: auto;
        }
        
        .cert-info h3 {
            font-size: 20px;
        }
        
        .cert-info p {
            font-size: 14px;
        }
        
        /* Show short button text, hide full text */
        .btn-text-full {
            display: none;
        }
        
        .btn-text-short {
            display: inline;
        }
        
        .cert-download-btn,
        .cert-linkedin-btn {
            font-size: 14px;
            padding: 10px 20px;
            width: 100%;
            max-width: 400px;
        }
        
        .cert-download-btn svg,
        .cert-linkedin-btn svg {
            width: 18px;
            height: 18px;
        }
        
        .cert-details {
            grid-template-columns: 1fr;
        }
        
        .cert-image {
            display: flex;
            justify-content: center;
            align-items: center;
        }
        
        .cert-image img {
            max-width: 100%;
            width: 100%;
        }

        .cert-actions {
            flex-direction: column;
            align-items: center;
        }

        .cert-validation-container {
            padding: 10px;
        }

        .cert-validation-form,
        .cert-result-container {
            padding: 20px;
        }
    }
}
