/*
Theme Name: Coupon.com.in
Theme URI: http://coupon.com.in
Author: Hitesh Mistari
Author URI: http://coupon.com.in
Description: Custom WordPress theme for Coupon.com.in
Version: 1.0.0
Text Domain: couponcomin
*/

/* --- MODERN BRAND-ALIGNED TABLE STYLES --- */

/* Reset Gutenberg wrappers to behave nicely */
figure.wp-block-table {
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
    overflow-x: auto !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
    border: 1px solid #E5E7EB !important;
}
figure.wp-block-table table {
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
}

/* Main Table Container (Applies to all tables) */
table, .wp-block-table table, .prose table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background-color: #ffffff !important;
    font-size: 0.85rem !important;
    text-align: left !important;
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
    border: 1px solid #E5E7EB !important;
}

/* Fix margin and border if table is already wrapped in Gutenberg figure */
figure.wp-block-table table {
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* Table Headers */
table th, .wp-block-table th, .prose th {
    background-color: #00291C !important;
    color: #ffffff !important;
    font-weight: 500 !important;
    padding: 0.75rem 1rem !important;
    border-bottom: 3px solid #84cc16 !important; /* Brand Lime Green accent */
    border-right: none !important;
    border-left: none !important;
    border-top: none !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    font-size: 0.85rem !important;
    vertical-align: middle !important;
    line-height: 1.4 !important;
}

/* Table Cells */
table td, .wp-block-table td, .prose td {
    padding: 0.5rem 1rem !important;
    color: #374151 !important;
    border-bottom: 1px solid #E5E7EB !important;
    border-right: none !important;
    border-left: none !important;
    border-top: none !important;
    vertical-align: middle !important;
    line-height: 1.4 !important;
}

/* Zebra Striping */
table tbody tr:nth-child(even) td, 
.wp-block-table tbody tr:nth-child(even) td, 
.prose tbody tr:nth-child(even) td {
    background-color: #F9FAFB !important;
}

table tbody tr:nth-child(odd) td, 
.wp-block-table tbody tr:nth-child(odd) td, 
.prose tbody tr:nth-child(odd) td {
    background-color: #ffffff !important;
}

/* Hover Effect */
table tbody tr:hover td, 
.wp-block-table tbody tr:hover td, 
.prose tbody tr:hover td {
    background-color: rgba(132, 204, 22, 0.08) !important; /* Light lime green tint */
    transition: background-color 0.2s ease-in-out !important;
}

/* Remove bottom border from last row */
table tbody tr:last-child td, 
.wp-block-table tbody tr:last-child td, 
.prose tbody tr:last-child td {
    border-bottom: none !important;
}

/* --- DARK MODE SUPPORT --- */
.dark figure.wp-block-table {
    border-color: #2A303C !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2) !important;
}

.dark table, .dark .wp-block-table table, .dark .prose table {
    background-color: #1A1F26 !important;
    border-color: #2A303C !important;
}
.dark figure.wp-block-table table {
    border: none !important;
}

.dark table th, .dark .wp-block-table th, .dark .prose th {
    background-color: #11151A !important;
    color: #ffffff !important;
    border-bottom: 3px solid #84cc16 !important;
}

.dark table td, .dark .wp-block-table td, .dark .prose td {
    color: #D1D5DB !important;
    border-bottom: 1px solid #2A303C !important;
}

.dark table tbody tr:nth-child(even) td, 
.dark .wp-block-table tbody tr:nth-child(even) td, 
.dark .prose tbody tr:nth-child(even) td {
    background-color: #1E242C !important;
}

.dark table tbody tr:nth-child(odd) td, 
.dark .wp-block-table tbody tr:nth-child(odd) td, 
.dark .prose tbody tr:nth-child(odd) td {
    background-color: #1A1F26 !important;
}

.dark table tbody tr:hover td, 
.dark .wp-block-table tbody tr:hover td, 
.dark .prose tbody tr:hover td {
    background-color: rgba(132, 204, 22, 0.15) !important;
}
