/**
 * Frontend Styles for Simple Password Protect Plugin
 * 
 * @package SimplePasswordProtect
 */

/* Reset and base styles */
* {
    box-sizing: border-box;
}

body.simple-pwd-protect-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #ffffff;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.6;
    color: #1e293b !important;
}

/* Main container */
.spp-container {
    background: #ffffff !important;
    color: #1e293b !important;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Top gradient border removed per user request */

/* Logo */
.spp-logo {
    max-width: 100%;
    max-height: 80px;
    margin-bottom: 20px;
    width: auto;
    border-radius: 8px;
}

/* Logo shape variations */
.spp-logo.square {
    border-radius: 4px;
}

.spp-logo.rounded {
    border-radius: 12px;
}

.spp-logo.round {
    max-width: 80px;
    max-height: 80px;
    border-radius: 50%;
    object-fit: cover;
    width: 80px;
    height: 80px;
}

/* Typography */
.spp-title {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.spp-text {
    color: #64748b;
    margin-bottom: 30px;
    line-height: 1.6;
    font-size: 16px;
}

/* Form styles */
.spp-form {
    margin-bottom: 20px;
}

.spp-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.spp-input:focus {
    outline: none;
    border-color: #17525b;
    background: white;
    box-shadow: 0 0 0 3px rgba(23, 82, 91, 0.1);
    transform: translateY(-1px);
}

.spp-input::placeholder {
    color: #94a3b8;
}

.spp-button {
    width: 100%;
    padding: 14px 18px;
    background: #17525b;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.spp-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.spp-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(23, 82, 91, 0.3);
    opacity: 0.9;
}

.spp-button:hover::before {
    left: 100%;
}

.spp-button:active {
    transform: translateY(0);
}

.spp-button:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.spp-button:disabled::before {
    display: none;
}

/* Error message */
.spp-error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #dc2626;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #fca5a5;
    font-weight: 500;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Legal links */
.spp-legal-links {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.spp-legal-link {
    color: #17525b;
    text-decoration: none;
    margin: 0 12px;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.3s ease;
    font-weight: 500;
}

.spp-legal-link:hover {
    color: #17525b;
    text-decoration: underline;
    opacity: 0.8;
}

/* Modal styles */
.spp-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.spp-modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.spp-modal-content {
    background: #ffffff !important;
    color: #1e293b !important;
    border-radius: 12px;
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    margin: auto;
    overflow: hidden;
    position: relative;
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.spp-modal-header {
    padding: 24px 60px 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9) !important;
    width: 100%;
    position: relative;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.spp-modal-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 22px;
    color: #1e293b !important;
    font-weight: 700;
    text-align: left;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.spp-modal-close {
    background: #f1f5f9 !important;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    color: #64748b !important;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    position: absolute;
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
    z-index: 10;
}

.spp-modal-close:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
    transform: translateY(-50%);
}

.spp-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(85vh - 100px);
    -webkit-overflow-scrolling: touch;
    background: #ffffff !important;
    color: #1e293b !important;
}

.spp-modal-body h1,
.spp-modal-body h2,
.spp-modal-body h3,
.spp-modal-body h4,
.spp-modal-body h5,
.spp-modal-body h6 {
    color: #1e293b !important;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.spp-modal-body h1:first-child,
.spp-modal-body h2:first-child,
.spp-modal-body h3:first-child {
    margin-top: 0;
}

.spp-modal-body p {
    color: #475569 !important;
    line-height: 1.7;
    margin-bottom: 1em;
}

.spp-modal-body a {
    color: #17525b !important;
    text-decoration: none;
}

.spp-modal-body a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px) scale(0.9); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0) scale(1); 
        opacity: 1; 
    }
}

/* Loading spinner */
.spp-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #17525b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

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

/* Responsive design */
@media (max-width: 480px) {
    .spp-container {
        margin: 20px;
        padding: 30px 24px;
        max-width: none;
    }
    
    .spp-title {
        font-size: 24px;
    }
    
    .spp-input,
    .spp-button {
        padding: 12px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .spp-modal {
        padding: 15px;
        align-items: center;
        justify-content: center;
    }
    
    .spp-modal-content {
        margin: 0;
        max-height: 92vh;
        max-width: none;
        width: calc(100% - 30px);
    }
    
    .spp-modal-header {
        padding: 20px 20px 16px;
    }
    
    .spp-modal-body {
        padding: 20px;
        max-height: calc(90vh - 90px);
    }
    
    .spp-modal-title {
        font-size: 20px;
    }
    
    .spp-legal-link {
        display: block;
        margin: 8px 0;
    }
}

@media (max-width: 320px) {
    .spp-container {
        padding: 24px 20px;
    }
    
    .spp-title {
        font-size: 22px;
    }
    
    .spp-modal {
        padding: 10px;
    }
    
    .spp-modal-content {
        width: calc(100% - 20px);
        max-height: 95vh;
    }
    
    .spp-modal-header {
        padding: 15px;
    }
    
    .spp-modal-body {
        padding: 15px;
        max-height: calc(95vh - 70px);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .spp-container {
        border: 2px solid #000;
    }
    
    .spp-input {
        border-color: #000;
    }
    
    .spp-button {
        background: #000;
    }
    
    .spp-legal-link {
        color: #0066cc;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .spp-button,
    .spp-input,
    .spp-modal,
    .spp-modal-content,
    .spp-modal-close {
        animation: none;
        transition: none;
    }
    
    .spp-button:hover {
        transform: none;
    }
    
    .spp-error {
        animation: none;
    }
}

/* Additional admin settings support */
.spp-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.spp-modal-error {
    text-align: center;
    padding: 20px;
}

/* Ensure proper modal backdrop centering */
.spp-modal {
    align-items: center !important;
    justify-content: center !important;
}

.spp-modal-content {
    position: relative;
    max-width: 90vw;
}

/* Enhanced loading state */
.spp-loading-text {
    color: #64748b;
    font-size: 14px;
}

/* Light theme only - using admin settings colors exclusively */ 