/* 
 * Main Stylesheet
 * Tamil Nadu Political Party Membership Card System
 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Tamil:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #ed2027;
    --secondary-color: #fbed22;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --tamil-font: 'Noto Sans Tamil', sans-serif;
    --english-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: var(--english-font);
    background-color: #f5f5f5;
    color: var(--dark-color);
}

.tamil-text {
    font-family: var(--tamil-font);
    font-weight: 500;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: rgb(255, 255, 255) !important;
}

.navbar-brand .tamil-text {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Container */
.container-custom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Forms */
.form-section {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.form-section h2 {
    color: black;
    margin-bottom: 25px;
    padding-bottom: 15px;
    
    font-weight: 600;
}

hr{
    width: 100%;
    height: 5px;
    background-color: var(--primary-color);
    border: 2px solid var(--primary-color);
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 8px;
    display: block;
}

.form-group label .required {
    color: var(--danger-color);
}

.form-control {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 10px 15px;
    font-family: var(--english-font);
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
    outline: none;
}

.form-control.tamil-text {
    font-family: var(--tamil-font);
}

/* Input validation */
.form-control.is-invalid {
    border-color: var(--danger-color);
}

.form-control.is-valid {
    border-color: var(--success-color);
}

.invalid-feedback {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
}

.valid-feedback {
    color: var(--success-color);
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
}

/* File Upload */
.file-upload-wrapper {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.file-upload-wrapper:hover {
    border-color: var(--primary-color);
    background-color: #fff5f0;
}

.file-upload-wrapper.dragover {
    border-color: var(--primary-color);
    background-color: rgba(255, 107, 53, 0.05);
}

.file-upload-wrapper input[type="file"] {
    display: none;
}

.file-upload-wrapper label {
    cursor: pointer;
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.file-info {
    font-size: 0.85rem;
    color: #666;
    margin-top: 10px;
}

.file-preview {
    margin-top: 15px;
}

.file-preview img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    color: var(--dark-color);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 78, 137, 0.3);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-block {
    width: 100%;
    margin-top: 20px;
}

/* Alert Messages */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid transparent;
}

.alert-success {
    background-color: #d4edda;
    border-left-color: var(--success-color);
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-left-color: var(--danger-color);
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border-left-color: #17a2b8;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    border-left-color: var(--warning-color);
    color: #856404;
}

/* Card Preview */
.card-preview {
    max-width: 400px;
    margin: 20px auto;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.card-front, .card-back {
    position: relative;
    width: 100%;
    height: auto;
}

.card-front img, .card-back img {
    width: 100%;
    height: auto;
    display: block;
}

.card-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    color: white;
}

.member-photo {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 80px;
    height: 100px;
    border-radius: 5px;
    overflow: hidden;
    border: 2px solid white;
}

.member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qr-code {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 80px;
    height: 80px;
    background: white;
    padding: 5px;
    border-radius: 5px;
}

.qr-code img {
    width: 100%;
    height: 100%;
}

.card-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
}

.card-info .tamil-text {
    font-size: 1rem;
    margin-bottom: 5px;
}

.member-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.member-details {
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Verification Badge */
.badge {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Admin Panel */
.admin-sidebar {
    background: linear-gradient(180deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    min-height: 100vh;
    padding: 20px;
    color: white;
}

.admin-sidebar .nav {
    list-style: none;
}

.admin-sidebar .nav li {
    margin-bottom: 10px;
}

.admin-sidebar .nav a {
    color: #ccc;
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: block;
}

.admin-sidebar .nav a:hover,
.admin-sidebar .nav a.active {
    background-color: rgba(255, 107, 53, 0.3);
    color: white;
    padding-left: 20px;
}

.admin-main {
    padding: 30px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-header h1 {
    color: var(--secondary-color);
    margin: 0;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.table thead {
    background-color: var(--secondary-color);
    color: white;
}

.table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.table tbody tr:hover {
    background-color: #f9f9f9;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    color: var(--secondary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: var(--dark-color);
}

/* Responsive */
@media (max-width: 768px) {
    .form-section {
        padding: 20px;
    }
    
    .card-preview {
        max-width: 100%;
    }
    
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        min-height: auto;
    }
    
    .member-photo {
        width: 60px;
        height: 80px;
    }
    
    .qr-code {
        width: 60px;
        height: 60px;
    }
    
    .card-info .tamil-text {
        font-size: 0.9rem;
    }
}

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.text-muted {
    color: #6c757d;
}

.success-message {
    color: var(--success-color);
    font-weight: 600;
}

.error-message {
    color: var(--danger-color);
    font-weight: 600;
}
