/* Phoenician Translator Plugin Styles */
/* Import Noto Sans Phoenician font from Google Fonts CDN */
@font-face {
    font-family: 'Noto Sans Phoenician';
    font-style: normal;
    font-weight: 400;
    src: url(https://fonts.gstatic.com/s/notosansphoenician/v17/ZgN0jOZKPa7CHqq0h37c7ReDUubm2SEdFXp7ig73qtTY5idb74R9UdM3y2nZLorxbq0iQw.woff2) format('woff2');
    unicode-range: U+10900-1091F;
}

@font-face {
    font-family: 'Noto Sans Historic';
    font-style: normal;
    font-weight: 400;
    src: local('Noto Sans Phoenician'), local('Segoe UI Historic'), local('Aegean');
}

/* Isolated styles with unique prefix to avoid WordPress theme conflicts */
.phoen-translator-wrapper {
    all: initial;
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.phoen-translator-wrapper * {
    box-sizing: border-box;
}

.phoen-container {
    background: linear-gradient(135deg, #534189 0%, #6b52a3 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(83, 65, 137, 0.3);
    position: relative;
}

.phoen-title {
    color: white;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 30px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.phoen-translator-area {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.phoen-input-group {
    margin-bottom: 20px;
}

.phoen-label {
    display: block;
    color: #534189;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.phoen-textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid #e0d9f0;
    border-radius: 10px;
    font-size: 18px;
    resize: vertical;
    transition: border-color 0.3s;
    font-family: inherit;
}

.phoen-textarea:focus {
    outline: none;
    border-color: #534189;
}

.phoen-textarea.phoenician-text {
    font-family: 'Noto Sans Phoenician', 'Noto Sans Historic', 'Segoe UI Historic', 'Aegean', 'Quivira', 'Code2000', 'Arial Unicode MS', sans-serif;
    font-size: 36px;
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    letter-spacing: 2px;
}

.phoen-switch-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.phoen-switch-btn {
    background: #534189;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(83, 65, 137, 0.4);
}

.phoen-switch-btn:hover {
    background: #6b52a3;
    transform: rotate(180deg);
}

.phoen-switch-btn:active {
    transform: rotate(180deg) scale(0.95);
}

.phoen-keyboard {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
}

.phoen-keyboard-title {
    color: #534189;
    font-weight: 600;
    margin: 0 0 15px 0;
    font-size: 16px;
    text-align: center;
}

.phoen-keyboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0; /* we'll use row containers for spacing */
}

.phoen-keyboard-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
}

.phoen-key {
    background: #f5f2fa;
    border: 2px solid #e0d9f0;
    border-radius: 8px;
    padding: 10px 6px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    flex: 1 1 0; /* let keys share row space evenly */
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    touch-action: manipulation;
}

.phoen-key:hover {
    background: #534189;
    border-color: #534189;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(83, 65, 137, 0.3);
}

.phoen-key:hover .phoen-char {
    color: white;
}

.phoen-key:hover .phoen-latin {
    color: rgba(255, 255, 255, 0.8);
}

.phoen-key:active {
    transform: translateY(0);
}

.phoen-char {
    font-family: 'Noto Sans Phoenician', 'Noto Sans Historic', 'Segoe UI Historic', 'Aegean', 'Quivira', 'Code2000', 'Arial Unicode MS', sans-serif;
    font-size: 30px;
    color: #534189;
    font-weight: 400;
    margin-bottom: 6px;
    letter-spacing: 0;
    line-height: 1;
}

.phoen-latin {
    font-size: 11px;
    color: #7d6ba8;
    font-weight: 500;
}

.phoen-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.phoen-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.phoen-btn-primary {
    background: #534189;
    color: white;
}

.phoen-btn-primary:hover {
    background: #6b52a3;
    box-shadow: 0 4px 15px rgba(83, 65, 137, 0.4);
}

.phoen-btn-secondary {
    background: white;
    color: #534189;
    border: 2px solid #534189;
}

.phoen-btn-secondary:hover {
    background: #f5f2fa;
}

.phoen-info {
    color: white;
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    opacity: 0.9;
}

.phoen-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #534189;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(83, 65, 137, 0.5);
    z-index: 10000;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    max-width: 90%;
    text-align: center;
    border: 2px solid white;
}

/* ========================================
   MOBILE STYLES (SEPARATED FROM DESKTOP)
   ======================================== */

@media (max-width: 600px) {
    /* Container adjustments for mobile */
    .phoen-container {
        padding: 20px 15px;
    }
    
    .phoen-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    /* Translator area adjustments */
    .phoen-translator-area {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    /* Input fields - mobile friendly with larger touch targets */
    .phoen-label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .phoen-textarea {
        min-height: 110px;
        padding: 14px;
        font-size: 16px; /* Prevent iOS zoom on focus */
        border-radius: 8px;
        border-width: 2px;
    }
    
    .phoen-textarea.phoenician-text {
        font-size: 26px;
        padding: 12px;
        line-height: 1.5;
    }
    
    /* Switch button - slightly smaller on mobile */
    .phoen-switch-container {
        margin: 15px 0;
    }
    
    .phoen-switch-btn {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    
    /* Control buttons - reduced size for mobile */
    .phoen-controls {
        gap: 8px;
        margin-top: 12px;
    }
    
    .phoen-btn {
        min-width: 80px;
        padding: 10px 16px;
        font-size: 13px;
        font-weight: 600;
        border-radius: 6px;
    }
    
    .phoen-btn-secondary {
        border-width: 2px;
    }
    
    /* Keyboard section - mobile optimized */
    .phoen-keyboard {
        padding: 15px 10px;
        margin-top: 15px;
    }
    
    .phoen-keyboard-title {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .phoen-keyboard-row {
        gap: 5px;
        margin-bottom: 6px;
    }

    .phoen-key {
        min-height: 56px;
        padding: 8px 4px;
        border-radius: 6px;
        border-width: 1.5px;
    }

    .phoen-char {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .phoen-latin {
        font-size: 10px;
    }
    
    /* Info text - mobile */
    .phoen-info {
        font-size: 12px;
        margin-top: 15px;
    }
    
    /* Notification - mobile friendly */
    .phoen-notification {
        padding: 12px 20px;
        font-size: 13px;
        max-width: 85%;
        top: 15px;
    }
}

/* Extra small devices (phones in portrait, less than 400px) */
@media (max-width: 400px) {
    .phoen-title {
        font-size: 18px;
    }
    
    .phoen-textarea {
        min-height: 100px;
        padding: 12px;
        font-size: 16px;
    }
    
    .phoen-textarea.phoenician-text {
        font-size: 24px;
    }
    
    .phoen-btn {
        min-width: 70px;
        padding: 9px 14px;
        font-size: 12px;
    }
    
    .phoen-keyboard-row {
        gap: 4px;
        margin-bottom: 5px;
    }
    
    .phoen-key {
        min-height: 52px;
        padding: 6px 3px;
    }
    
    .phoen-char {
        font-size: 18px;
    }
    
    .phoen-latin {
        font-size: 9px;
    }
}
