/**
 * PgMP Contribute Plugin Styles
 * Version: 1.0.0
 */

/* Google Font */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* FAB Button */
.pgmp-contribute-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #0066CC 0%, #004494 100%);
    color: white;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0, 102, 204, 0.45);
    z-index: 999997;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    font-size: 15px;
    border: none;
    text-decoration: none;
}

.pgmp-contribute-fab:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 12px 40px rgba(0, 102, 204, 0.55);
}

.pgmp-contribute-fab:active {
    transform: translateY(-2px) scale(1.01);
}

.pgmp-contribute-fab .fab-icon {
    font-size: 20px;
    line-height: 1;
}

.pgmp-contribute-fab .fab-label {
    white-space: nowrap;
}

/* Modal Overlay */
.pgmp-contribute-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 999998;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pgmp-contribute-overlay.active {
    display: flex;
    opacity: 1;
}

/* Modal */
.pgmp-contribute-modal {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.35);
    animation: pgmpModalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pgmpModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.pgmp-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    color: white;
    transition: all 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.pgmp-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Modal Header */
.pgmp-modal-header {
    background: linear-gradient(135deg, #0066CC 0%, #004494 100%);
    color: white;
    padding: 36px 32px 32px;
    text-align: center;
    border-radius: 24px 24px 0 0;
    position: relative;
    overflow: hidden;
}

.pgmp-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.pgmp-modal-header::after {
    content: '';
    position: absolute;
    bottom: -60%;
    left: -20%;
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.pgmp-modal-icon {
    font-size: 48px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.pgmp-modal-header h2 {
    margin: 0 0 8px 0;
    font-size: 26px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    letter-spacing: -0.02em;
}

.pgmp-modal-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 15px;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

/* Form */
.pgmp-contribute-form {
    padding: 28px 32px 32px;
}

.pgmp-field {
    margin-bottom: 24px;
}

.pgmp-label {
    display: block;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
    font-size: 14px;
    letter-spacing: 0.01em;
}

.pgmp-label .required {
    color: #ef4444;
    margin-left: 2px;
}

/* Type Selection Cards */
.pgmp-type-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.pgmp-type-option {
    cursor: pointer;
    display: block;
}

.pgmp-type-option input {
    display: none;
}

.pgmp-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 12px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.pgmp-type-card:hover {
    border-color: #0066CC;
    background: #f0f7ff;
    transform: translateY(-2px);
}

.pgmp-type-option input:checked + .pgmp-type-card {
    border-color: #0066CC;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.08) 0%, rgba(0, 68, 148, 0.08) 100%);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.18);
}

.pgmp-type-icon {
    font-size: 32px;
    margin-bottom: 8px;
    line-height: 1;
}

.pgmp-type-content {
    display: flex;
    flex-direction: column;
}

.pgmp-type-name {
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
}

.pgmp-type-desc {
    font-size: 11px;
    color: #64748b;
    margin-top: 3px;
}

/* Input Fields */
.pgmp-contribute-form input[type="text"],
.pgmp-contribute-form input[type="email"],
.pgmp-contribute-form textarea,
.pgmp-contribute-form select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
    background: #f8fafc;
    color: #1e293b;
    box-sizing: border-box;
}

.pgmp-contribute-form input[type="text"]:focus,
.pgmp-contribute-form input[type="email"]:focus,
.pgmp-contribute-form textarea:focus,
.pgmp-contribute-form select:focus {
    outline: none;
    border-color: #0066CC;
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

.pgmp-contribute-form textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.pgmp-contribute-form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 44px;
}

.pgmp-field-hint {
    text-align: right;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
}

/* Screenshot Upload */
.pgmp-screenshot-upload {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.pgmp-screenshot-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    color: #475569;
    transition: all 0.2s;
}

.pgmp-screenshot-btn:hover {
    border-color: #0066CC;
    background: #f0f7ff;
    color: #0066CC;
}

.pgmp-screenshot-preview {
    position: relative;
    display: inline-block;
}

.pgmp-screenshot-preview img {
    max-width: 120px;
    max-height: 80px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    object-fit: cover;
}

.pgmp-remove-screenshot {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pgmp-remove-screenshot:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Name/Email Row */
.pgmp-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Actions */
.pgmp-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 8px;
}

.pgmp-btn {
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-family: inherit;
}

.pgmp-btn.secondary {
    background: #f1f5f9;
    color: #475569;
}

.pgmp-btn.secondary:hover {
    background: #e2e8f0;
}

.pgmp-btn.primary {
    background: linear-gradient(135deg, #0066CC 0%, #004494 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.35);
}

.pgmp-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 102, 204, 0.45);
}

.pgmp-btn.primary:active {
    transform: translateY(-1px);
}

.pgmp-btn.primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Success State */
.pgmp-success {
    padding: 60px 32px;
    text-align: center;
    display: none;
}

.pgmp-success.active {
    display: block;
}

.pgmp-success-icon {
    font-size: 72px;
    margin-bottom: 20px;
    animation: pgmpSuccessPop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pgmpSuccessPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.pgmp-success h3 {
    font-size: 24px;
    color: #1e293b;
    margin: 0 0 12px 0;
    font-weight: 700;
}

.pgmp-success p {
    color: #64748b;
    margin: 0 0 10px 0;
    font-size: 15px;
    line-height: 1.6;
}

.pgmp-success .success-note {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 28px;
}

/* Privacy Notice */
.pgmp-privacy {
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* Error message */
.pgmp-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.pgmp-error.active {
    display: block;
}

/* Responsive */
@media (max-width: 600px) {
    .pgmp-contribute-fab {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        font-size: 14px;
    }

    .pgmp-contribute-fab .fab-label {
        display: none;
    }

    .pgmp-contribute-fab .fab-icon {
        font-size: 22px;
    }

    .pgmp-contribute-modal {
        border-radius: 20px 20px 0 0;
        max-height: 95vh;
        margin-top: auto;
    }

    .pgmp-type-options {
        grid-template-columns: 1fr;
    }

    .pgmp-type-card {
        flex-direction: row;
        justify-content: flex-start;
        gap: 14px;
        text-align: left;
        padding: 14px 18px;
    }

    .pgmp-type-icon {
        margin-bottom: 0;
        font-size: 28px;
    }
    
    .pgmp-type-content {
        align-items: flex-start;
    }

    .pgmp-row {
        grid-template-columns: 1fr;
    }

    .pgmp-contribute-form {
        padding: 24px 20px 28px;
    }

    .pgmp-modal-header {
        padding: 28px 20px 24px;
    }
    
    .pgmp-actions {
        flex-direction: column;
    }
    
    .pgmp-btn {
        width: 100%;
        text-align: center;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .pgmp-contribute-modal {
        background: #1e293b;
    }

    .pgmp-label {
        color: #e2e8f0;
    }

    .pgmp-contribute-form input[type="text"],
    .pgmp-contribute-form input[type="email"],
    .pgmp-contribute-form textarea,
    .pgmp-contribute-form select {
        background: #0f172a;
        border-color: #334155;
        color: #e2e8f0;
    }

    .pgmp-contribute-form input:focus,
    .pgmp-contribute-form textarea:focus,
    .pgmp-contribute-form select:focus {
        background: #1e293b;
        border-color: #0066CC;
    }

    .pgmp-type-card {
        background: #0f172a;
        border-color: #334155;
    }

    .pgmp-type-card:hover {
        background: #1e3a5f;
    }

    .pgmp-type-option input:checked + .pgmp-type-card {
        background: rgba(0, 102, 204, 0.15);
    }

    .pgmp-type-name {
        color: #e2e8f0;
    }

    .pgmp-type-desc {
        color: #94a3b8;
    }

    .pgmp-btn.secondary {
        background: #334155;
        color: #e2e8f0;
    }

    .pgmp-btn.secondary:hover {
        background: #475569;
    }

    .pgmp-success h3 {
        color: #e2e8f0;
    }

    .pgmp-success p {
        color: #94a3b8;
    }

    .pgmp-privacy {
        border-top-color: #334155;
        color: #64748b;
    }
    
    .pgmp-screenshot-btn {
        background: #334155;
        border-color: #475569;
        color: #e2e8f0;
    }
    
    .pgmp-screenshot-btn:hover {
        background: #1e3a5f;
        border-color: #0066CC;
    }
    
    .pgmp-field-hint {
        color: #64748b;
    }
}
