/* ========================================
   PETITIONS APP - Styles
   ======================================== */

/* Variables */
:root {
    --petition-green: #0E8040;
    --petition-green-dark: #0A6030;
    --petition-red: #ED2024;
    --petition-gold: #D4AF37;
    --petition-gray: #666;
    --petition-light-gray: #f5f5f5;
}

/* ========================================
   HERO ET TABS
   ======================================== */

.petition-hero {
    padding-bottom: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.petition-hero .page-hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding-bottom: 20px;
}

/* Tabs glassmorphism */
.petition-tabs-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
    flex-wrap: wrap;
    padding: 0 1rem;
    position: relative;
    z-index: 10;
    margin-bottom: -20px;
}

.petition-tab {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px;
    gap: 8px;
    width: 120px;
    height: 85px;
    background: rgba(255, 255, 255, 0.3);
    box-shadow: inset 0px -4px 15px rgba(0, 0, 0, 0.35);
    border-radius: 20px 20px 0px 0px;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.petition-tab:hover {
    background: rgba(255, 255, 255, 0.45);
    transform: translateY(-2px);
    text-decoration: none;
}

.petition-tab .tab-icon {
    font-size: 1.6rem;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
}

.petition-tab .tab-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #FFFFFF;
    text-align: center;
}

.petition-tab.active {
    background: #FFFFFF;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

.petition-tab.active .tab-icon {
    color: var(--petition-red);
}

.petition-tab.active .tab-label {
    color: #333;
    font-weight: 700;
}

/* ========================================
   CONTAINER ET GRID
   ======================================== */

.petition-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px 40px;
}

.petition-actions-bar {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.petition-intro {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
}

.petition-intro a {
    color: var(--petition-green);
    font-weight: 600;
}

.petition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* ========================================
   CARTE PETITION
   ======================================== */

.petition-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.petition-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.petition-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.petition-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.petition-card:hover .petition-image img {
    transform: scale(1.05);
}

.status-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-valide {
    background: #28a745;
    color: #fff;
}

.status-examine {
    background: #007bff;
    color: #fff;
}

.status-debattu {
    background: #6f42c1;
    color: #fff;
}

.status-hemicycle {
    background: var(--petition-gold);
    color: #000;
}

.status-fermee {
    background: #6c757d;
    color: #fff;
}

.popular-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--petition-red);
    color: #fff;
}

.petition-content {
    padding: 20px;
}

.petition-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    line-height: 1.4;
}

.petition-meta {
    margin-bottom: 15px;
    color: #666;
    font-size: 0.9rem;
}

.petition-meta i {
    color: var(--petition-green);
    margin-right: 5px;
}

/* Progress bar */
.petition-progress {
    margin-bottom: 15px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.signatures-count {
    font-weight: 600;
    color: var(--petition-green);
}

.signatures-goal {
    color: #666;
}

.progress-bar {
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--petition-green), #28a745);
    border-radius: 5px;
    transition: width 0.5s ease;
}

.progress-percentage {
    text-align: right;
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
}

.btn-petition {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 12px 20px;
    background: var(--petition-green);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.btn-petition:hover {
    background: var(--petition-green-dark);
    color: #fff;
}

/* Empty state */
.petition-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.petition-empty i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #ddd;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination-link:hover {
    background: #f8f9fa;
    border-color: var(--petition-green);
    color: var(--petition-green);
}

/* ========================================
   MODAL AUTHENTIFICATION
   ======================================== */

.petition-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.petition-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.petition-modal-close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #999;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.petition-modal-close:hover {
    color: #333;
}

.petition-modal-header {
    background: var(--petition-green);
    color: #fff;
    padding: 20px;
    position: relative;
}

.petition-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.petition-modal-body {
    padding: 25px;
}

.modal-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.modal-info-box {
    background: #f8f9fa;
    border-left: 4px solid var(--petition-green);
    padding: 15px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.modal-privacy-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #e8f5e9;
    border-radius: 8px;
    color: var(--petition-green);
    font-weight: 500;
}

.modal-privacy-notice i {
    font-size: 1.2rem;
}

.petition-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 25px 25px;
}

.btn-login,
.btn-register {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-login {
    background: var(--petition-green);
    color: #fff;
}

.btn-login:hover {
    background: var(--petition-green-dark);
    color: #fff;
}

.btn-register {
    background: #fff;
    color: var(--petition-green);
    border: 2px solid var(--petition-green);
}

.btn-register:hover {
    background: var(--petition-green);
    color: #fff;
}

/* ========================================
   DETAIL PETITION (REDESIGNED)
   ======================================== */

.petition-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.petition-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1.1fr;
    gap: 50px;
    align-items: start;
}

.petition-main {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.petition-detail-image {
    margin: -40px -40px 30px;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    position: relative;
    height: 350px;
}

.petition-detail-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
}

.petition-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.petition-title-main {
    font-size: 2.2rem;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.3;
    margin-bottom: 25px;
    letter-spacing: -0.5px;
}

.petition-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.95rem;
}

.meta-item i {
    color: var(--petition-green);
}

.meta-item.author strong {
    color: #333;
}

.petition-detail-description {
    line-height: 1.8;
    color: #333;
    font-size: 1.05rem;
    margin-bottom: 40px;
}

.petition-detail-description p {
    margin-bottom: 20px;
}

/* Milestones */
.petition-milestones {
    margin-bottom: 40px;
    background: #fcfcfc;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #f0f0f0;
}

.petition-milestones h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: #333;
}

.milestones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.milestone-card {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-radius: 10px;
    align-items: flex-start;
}

.milestone-card.success {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
}

.milestone-card.gold {
    background: #fff8e1;
    border: 1px solid #ffe0b2;
}

.milestone-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.success .milestone-icon {
    color: var(--petition-green);
}

.gold .milestone-icon {
    color: #f57f17;
}

.milestone-content strong {
    display: block;
    margin-bottom: 4px;
    color: #333;
}

.milestone-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
}

/* Signatures section */
.petition-signatures-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

.signatures-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
}

.signature-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    align-items: flex-start;
}

.signature-avatar {
    width: 40px;
    height: 40px;
    background: var(--petition-green);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.signature-content {
    flex: 1;
}

.signature-name {
    display: block;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.signature-comment {
    color: #555;
    font-style: italic;
    font-size: 0.95rem;
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-block;
    border: 1px solid #eee;
    margin-bottom: 5px;
}

.signature-date {
    display: block;
    color: #999;
    font-size: 0.8rem;
    margin-top: 5px;
}

.empty-signatures {
    text-align: center;
    padding: 40px;
    color: #999;
    background: #f9f9f9;
    border-radius: 12px;
}

.empty-signatures i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #ddd;
}

/* Sidebar & Action Card */
.petition-sidebar {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.petition-action-card,
.petition-share-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Red Gradient Style for Action Card */
.petition-action-card {
    border-top: none;
    background: linear-gradient(135deg, #ed2024 0%, #c91d20 100%);
    color: #ffffff;
}

.progress-section-featured {
    padding: 30px;
    background: transparent;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.signatures-counter {
    margin-bottom: 15px;
}

.signatures-counter .count {
    display: block;
    font-size: 3.5rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -2px;
}

.signatures-counter .label {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.progress-bar-container {
    height: 14px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 7px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar-main {
    height: 100%;
    width: 100%;
}

.progress-bar-main .progress-fill {
    height: 100%;
    background: #ffffff;
    border-radius: 7px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-goal {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.progress-goal strong {
    color: #ffffff;
}

.action-buttons-area {
    padding: 30px;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center content horizontally */
}

.cta-wrapper {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cta-text {
    margin-bottom: 15px;
    font-size: 1.05rem;
    color: #ffffff;
}

/* White Button Style */
.btn-sign-petition {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    /* Or auto if preferred, but keep full width for mobile */
    max-width: 300px;
    /* Limit width */
    padding: 16px 24px;
    background: #ffffff;
    color: #ed2024;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-sign-petition:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: #f8f9fa;
    color: #c91d20;
}

.pulse-animation {
    animation: pulse-shadow 2s infinite;
}

@keyframes pulse-shadow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.sign-form-wrapper {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(5px);
}


.user-greeting {
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: #666;
    text-align: center;
}

.signed-status {
    text-align: center;
    padding: 20px 0;
}

.check-animation {
    width: 80px;
    height: 80px;
    background: #e8f5e9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.5rem;
    color: #4caf50;
    animation: pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop-in {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.signed-status h3 {
    color: #2e7d32;
    margin-bottom: 10px;
}

.signed-status p {
    color: #666;
}

.closed-status {
    text-align: center;
    padding: 20px;
    color: #777;
}

.closed-status i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #ccc;
    display: block;
}

/* Share card */
.petition-share-card {
    padding: 25px;
    text-align: center;
}

.petition-share-card h4 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: #333;
}

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

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.share-btn {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.share-facebook {
    background: #1877f2;
}

.share-facebook:hover {
    background: #145dbf;
}

.share-twitter {
    background: #1da1f2;
}

.share-twitter:hover {
    background: #0d8bd9;
}

.share-whatsapp {
    background: #25d366;
}

.share-whatsapp:hover {
    background: #1ebe57;
}

.share-email {
    background: #666;
}

.share-email:hover {
    background: #444;
}

.share-link-copy {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    background: #f5f5f5;
    padding: 5px;
    border-radius: 8px;
}

.share-link-copy input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px;
    font-size: 0.85rem;
    color: #666;
    outline: none;
}

.btn-copy {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 35px;
    cursor: pointer;
    color: #333;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: #f0f0f0;
    color: var(--petition-green);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 992px) {
    .petition-detail-grid {
        grid-template-columns: 1fr;
    }

    .petition-sidebar {
        order: -1;
        position: static;
    }

    .petition-detail-image {
        height: 250px;
    }

    .petition-title-main {
        font-size: 1.8rem;
    }

    .petition-tabs-container {
        gap: 0.5rem;
        margin-top: 2rem;
    }

    .petition-tab {
        width: 100px;
        height: 75px;
        padding: 10px;
    }

    .petition-tab .tab-icon {
        font-size: 1.3rem;
    }

    .petition-tab .tab-label {
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .petition-tabs-container {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 10px;
    }

    .petition-tab {
        flex: 0 0 auto;
    }

    .petition-grid {
        grid-template-columns: 1fr;
    }

    .petition-main {
        padding: 25px;
    }

    .petition-milestones .milestones-grid {
        grid-template-columns: 1fr;
    }

    .petition-modal-content {
        margin: 10% auto;
        width: 95%;
    }
}

/* Pagination Styles */
.petition-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: #444;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid #eee;
}

.page-link:hover {
    background: #f0f0f0;
    color: #2c3e50;
    border-color: #ddd;
}

.page-link.active {
    background: #ed2024;
    color: #fff;
    border-color: #ed2024;
}

.page-link i {
    font-size: 0.9rem;
}


/* Form styling */
.form-group {
    margin-bottom: 15px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--petition-green);
    box-shadow: 0 0 0 3px rgba(14, 128, 64, 0.1);
}

.privacy-note {
    margin-top: 12px;
    font-size: 0.85rem;
    color: #888;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.privacy-note i {
    color: var(--petition-green);
}

/* Alert messages */
.petition-messages {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error,
.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}
