/**
 * E-Petition Frontend Styles
 */

.epetition-form-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.epetition-form-container h2 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

.epetition-form-container h3 {
    color: #34495e;
    margin-top: 30px;
    margin-bottom: 20px;
    font-size: 20px;
}

.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group .required {
    color: #e74c3c;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 13px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group input[type="file"] {
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    background: #fff;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
}

.form-actions {
    margin-top: 30px;
    text-align: center;
}

.btn-submit {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-submit:hover {
    background: #2980b9;
}

.btn-submit:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    display: none;
}

.form-message.success {
    display: block;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.form-message.error {
    display: block;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Petition List Styles */
.epetition-list-container {
    max-width: 1200px;
    margin: 40px auto;
}

.petition-item {
    background: #fff;
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s;
}

.petition-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.petition-item h3 {
    margin-top: 0;
    color: #2c3e50;
}

.petition-meta {
    display: flex;
    gap: 20px;
    margin: 10px 0;
    font-size: 14px;
    color: #7f8c8d;
}

.petition-meta .category {
    background: #ecf0f1;
    padding: 4px 10px;
    border-radius: 3px;
    font-weight: 600;
}

.petition-meta .signatures {
    color: #3498db;
    font-weight: 600;
}

.petition-item p {
    color: #34495e;
    line-height: 1.6;
}

.petition-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.btn-view-petition,
.btn-sign-petition {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-view-petition {
    background: #ecf0f1;
    color: #2c3e50;
}

.btn-view-petition:hover {
    background: #bdc3c7;
}

.btn-sign-petition {
    background: #3498db;
    color: #fff;
}

.btn-sign-petition:hover {
    background: #2980b9;
}

/* Loading spinner */
.epetition-loading {
    text-align: center;
    padding: 20px;
}

.epetition-loading:after {
    content: "";
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Petition Details Page Styles */
.epetition-details-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.petition-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #ecf0f1;
}

.petition-category-badge {
    display: inline-block;
    background: #3498db;
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.petition-title {
    font-size: 36px;
    color: #2c3e50;
    margin: 20px 0;
    line-height: 1.3;
}

.petition-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #3498db;
}

.stat-date {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.stat-label {
    font-size: 14px;
    color: #7f8c8d;
    margin-top: 5px;
}

.petition-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
}

@media (max-width: 968px) {
    .petition-content {
        grid-template-columns: 1fr;
    }
    
    .petition-sidebar {
        order: -1;
    }
}

.petition-main {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.petition-description h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 24px;
}

.description-text {
    font-size: 16px;
    line-height: 1.8;
    color: #34495e;
    margin-bottom: 30px;
}

.petition-documents {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
}

.petition-documents h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.document-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.document-list li {
    margin-bottom: 10px;
}

.document-link {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s;
}

.document-link:hover {
    background: #ecf0f1;
    transform: translateX(5px);
}

.document-icon {
    margin-right: 10px;
    font-size: 20px;
}

.petition-petitioner {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #ecf0f1;
}

.petition-petitioner h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.petitioner-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
}

.petitioner-district {
    color: #7f8c8d;
    margin-top: 5px;
}

.location-icon {
    margin-right: 5px;
}

/* Sidebar Styles */
.petition-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.signature-box,
.share-box,
.back-to-list {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.signature-progress {
    text-align: center;
    margin-bottom: 20px;
}

.progress-number {
    font-size: 48px;
    font-weight: 700;
    color: #3498db;
}

.progress-label {
    font-size: 16px;
    color: #7f8c8d;
    margin-top: 5px;
}

.btn-sign-petition-large {
    width: 100%;
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 18px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-sign-petition-large:hover {
    background: #c0392b;
}

.signature-form {
    margin-top: 20px;
}

.signature-form h4 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.btn-submit-signature {
    width: 100%;
    background: #27ae60;
    color: #fff;
    border: none;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 10px;
}

.btn-submit-signature:hover {
    background: #229954;
}

.btn-cancel-signature {
    width: 100%;
    background: #95a5a6;
    color: #fff;
    border: none;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
}

.btn-cancel-signature:hover {
    background: #7f8c8d;
}

.signature-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    display: none;
}

.signature-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
}

.signature-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
}

.share-box h4 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 4px;
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    transition: opacity 0.3s;
}

.share-btn:hover {
    opacity: 0.8;
}

.share-btn span {
    margin-right: 8px;
}

.share-btn.facebook {
    background: #3b5998;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.whatsapp {
    background: #25d366;
}

.share-btn.email {
    background: #7f8c8d;
}

.btn-back {
    display: block;
    text-align: center;
    padding: 12px;
    background: #ecf0f1;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-back:hover {
    background: #bdc3c7;
}

.epetition-error {
    max-width: 600px;
    margin: 60px auto;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.epetition-error p {
    font-size: 18px;
    color: #7f8c8d;
}

/* Signature box styles */
.signature-login-required {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
}

.signature-login-required p {
    margin-bottom: 15px;
    color: #7f8c8d;
}

.register-link {
    font-size: 14px;
    margin-top: 10px;
}

.register-link a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.register-link a:hover {
    text-decoration: underline;
}

.already-signed {
    text-align: center;
    padding: 30px 20px;
    background: #d4edda;
    border-radius: 5px;
    border: 2px solid #c3e6cb;
}

.already-signed .success-message {
    font-size: 18px;
    font-weight: 700;
    color: #155724;
    margin-bottom: 10px;
}

.already-signed .thank-you {
    font-size: 14px;
    color: #155724;
    margin: 0;
}

/* Supporting information styles for petition title and description */
#petition-title-char-text,
#petition-description-char-text,
#petition-background-char-text,
#petition-title-sample-text,
#petition-title-sample-ques,
#petition-tile-example-group {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.5;
    margin-top: 8px;
}

#petition-title-char-text,
#petition-description-char-text,
#petition-background-char-text,
#petition-title-sample-text {
    font-style: italic;
    color: #95a5a6;
}

#petition-title-char-text #title-char-count,
#petition-description-char-text #description-char-count,
#petition-background-char-text #background-char-count {
    font-weight: 600;
    color: #7f8c8d;
}

#petition-title-sample-ques {
    padding: 10px;
    background: #f8f9fa;
    border-left: 3px solid #6c757d;
    margin-top: 10px;
    font-style: italic;
}

#petition-tile-example-group {
    padding: 15px;
    background: #f1f3f5;
    border-radius: 5px;
    margin-top: 12px;
}

#petition-title-good-example,
#petition-title-bad-example {
    margin-bottom: 12px;
    font-size: 12px;
}

#petition-title-good-example {
    color: #28a745;
}

#petition-title-bad-example {
    color: #dc3545;
}

#petition-tile-example-group ul {
    margin: 8px 0 0 20px;
    padding: 0;
}

#petition-tile-example-group li {
    margin: 4px 0;
    color: #6c757d;
}

#petition-tile-example-group > div:last-of-type {
    margin-bottom: 0;
}

.petition-background {
    margin: 30px 0;
    padding-top: 30px;
    border-top: 1px solid #ecf0f1;
}

.petition-background h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 24px;
}

.background-text {
    font-size: 16px;
    line-height: 1.8;
    color: #34495e;
    margin-bottom: 30px;
}

/* My Petitions Styles */
.my-petitions h2 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 28px;
}

.my-petition-item {
    position: relative;
}

.petition-status-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.petition-status-badge.status-pending {
    background: #f39c12;
    color: #fff;
}

.petition-status-badge.status-approved {
    background: #27ae60;
    color: #fff;
}

.petition-status-badge.status-rejected {
    background: #e74c3c;
    color: #fff;
}

.petition-status-badge.status-under_review {
    background: #3498db;
    color: #fff;
}

.admin-notes {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    border-radius: 4px;
}

.admin-notes strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 5px;
}

.admin-notes p {
    margin: 0;
    color: #7f8c8d;
    font-size: 14px;
}

.no-petitions {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.no-petitions p {
    font-size: 18px;
    color: #7f8c8d;
    margin-bottom: 20px;
}

.btn-share-petition {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    background: #9b59b6;
    color: #fff;
}

.btn-share-petition:hover {
    background: #8e44ad;
}

/* Edit Petition Styles */
.epetition-edit-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #3498db;
}

.edit-header h1 {
    margin: 0;
    color: #2c3e50;
}

.edit-locked-notice {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.edit-locked-notice p {
    margin: 5px 0;
    color: #856404;
}

.admin-notes-box {
    background: #d4edda;
    border-left: 4px solid #28a745;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 4px;
}

.admin-notes-box h3 {
    margin-top: 0;
    color: #155724;
}

.admin-notes-box p {
    margin: 0;
    color: #155724;
}

.petition-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-box {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
}

.stat-label {
    font-size: 12px;
    color: #7f8c8d;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
}

.btn-update,
.btn-delete,
.btn-cancel {
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    margin-right: 10px;
}

.btn-update {
    background: #3498db;
    color: #fff;
}

.btn-update:hover {
    background: #2980b9;
}

.btn-delete {
    background: #e74c3c;
    color: #fff;
}

.btn-delete:hover {
    background: #c0392b;
}

.btn-cancel {
    background: #95a5a6;
    color: #fff;
}

.btn-cancel:hover {
    background: #7f8c8d;
}

input[readonly],
textarea[readonly],
select[disabled] {
    background: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .petition-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .edit-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .petition-status-badge {
        margin-top: 10px;
    }
}

