
.cpt-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.cpt-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.cpt-form .form-row {
    margin-bottom: 15px;
    
}

.cpt-form input[type='text'],
.cpt-form input[type='number'] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: black!important;
}
#pmpro_company_name{
    color: black!important;
}

.cpt-form .field-note {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.cpt-form button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.cpt-form button:hover {
    background-color: #45a049;
}

.cpt-results {
    margin-top: 30px;
}

.cpt-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.cpt-table th, .cpt-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    min-width: 120px; 
}

.cpt-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.cpt-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.cpt-table tr:hover {
    background-color: #f1f1f1;
}

.cpt-download-btn {
    background-color: #2196F3;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-top: 5px;
}

.cpt-download-btn:hover {
    background-color: #0b7dda;
}
.cpt-download-btn2 {
    background-color: #2196F3;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-top: 5px;
}

.cpt-download-btn2:hover {
    background-color: #0b7dda;
}

.cpt-message {
    margin: 15px 0;
    padding: 10px;
    border-radius: 4px;
}

.cpt-success {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.cpt-error {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

@media screen and (max-width: 600px) {
    .cpt-form {
        padding: 10px;
    }
    
    .cpt-table {
        display: block;
        overflow-x: auto;
    }
}
#cpt-data-table-container{
    width: 100%!important;
    overflow-x: scroll;
}



















/* Customer Profitability Tracker v2.0 Styles - Aligned with existing structure */

/* Keep your existing form base styles */
.cpt-form {
    max-width: 1000px; /* Increased for new sections */
    margin: 0 auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.cpt-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.cpt-form .form-row {
    margin-bottom: 15px;
}

.cpt-form input[type='text'],
.cpt-form input[type='number'],
.cpt-form select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: black!important;
    box-sizing: border-box;
}

#pmpro_company_name {
    color: black!important;
}

.cpt-form .field-note {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

.cpt-form button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.cpt-form button:hover {
    background-color: #45a049;
}

/* NEW: Styling for v2.0 form sections */
.cpt-section {
    background: #ffffff;
    padding: 25px;
    margin: 20px 0;
    border-radius: 6px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.cpt-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #4CAF50;
    font-size: 22px;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
}

.section-note {
    background: #fff3cd;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #ffc107;
    margin-bottom: 20px;
    font-size: 14px;
    color: #856404;
}

.form-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
    border-left: 4px solid #4CAF50;
}

.form-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #4CAF50;
    font-size: 18px;
    font-weight: 600;
}

/* Special styling for calculated time section */
.calculated-time {
    background: #e8f5e8 !important;
    border-left-color: #4CAF50 !important;
    text-align: center;
    padding: 25px !important;
    border: 2px solid #4CAF50 !important;
}

.time-display {
    font-size: 32px;
    font-weight: bold;
    color: #4CAF50;
    margin: 15px 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.time-display:hover {
    transform: scale(1.05);
    color: #45a049;
}

.time-display.updated {
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Enhanced select styling */
select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg viewBox="0 0 4 5" xmlns="http://www.w3.org/2000/svg"><path fill="%23666" d="m2 0-2 2h4zm0 5 2-2h-4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Keep your existing results section */
.cpt-results {
    margin-top: 30px;
}

.cpt-results h3 {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
}

/* Keep your existing table styles */
.cpt-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cpt-table th, .cpt-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    min-width: 120px; 
}

.cpt-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.cpt-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.cpt-table tr:hover {
    background-color: #f1f1f1;
}

/* Keep your existing button styles with enhancements */
.cpt-download-btn {
    background-color: #2196F3;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-top: 5px;
    transition: all 0.3s ease;
}

.cpt-download-btn:hover {
    background-color: #0b7dda;
    transform: translateY(-1px);
}

.cpt-download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cpt-download-btn2 {
    background-color: #2196F3;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-top: 5px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.cpt-download-btn2:hover {
    background-color: #0b7dda;
    transform: translateY(-1px);
}

/* Keep your existing message styles */
.cpt-message {
    margin: 15px 0;
    padding: 10px;
    border-radius: 4px;
}

.cpt-success {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.cpt-error {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

/* Enhanced data table container */
#cpt-data-table-container {
    width: 100%!important;
    overflow-x: auto;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Loading states */
.loading-spinner {
    display: inline-block;
    padding: 20px;
    text-align: center;
    color: #666;
}

.loading-spinner:after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Form validation styles */
input.error, select.error {
    border-color: #a94442 !important;
    background-color: #fff5f5 !important;
}

input:invalid {
    border-color: #a94442;
}

input:valid {
    border-color: #3c763d;
}

/* Enhanced responsive design */
@media screen and (max-width: 600px) {
    .cpt-form {
        padding: 15px;
        margin: 10px;
    }
    
    .cpt-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .form-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .time-display {
        font-size: 24px;
    }
    
    .cpt-table {
        display: block;
        overflow-x: auto;
        font-size: 12px;
    }
    
    .cpt-table th,
    .cpt-table td {
        padding: 6px 8px;
        min-width: 100px;
    }
    
    .form-section h4 {
        font-size: 16px;
    }
    
    .cpt-section h3 {
        font-size: 18px;
    }
    
    /* Stack form fields on mobile */
    .form-row {
        margin-bottom: 12px;
    }
    
    .cpt-download-btn2 {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* Grid layout for larger screens */
@media screen and (min-width: 992px) {
    .form-section {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
        align-items: start;
    }
    
    .form-section h4 {
        grid-column: 1 / -1;
        margin-bottom: 10px;
    }
    
    .form-row {
        margin-bottom: 10px;
    }
}

/* Improved accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for better accessibility */
input:focus,
select:focus,
button:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .cpt-download-btn,
    .cpt-download-btn2,
    .cpt-form button {
        display: none;
    }
    
    .cpt-form {
        box-shadow: none;
        background: white;
    }
    
    .cpt-section {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}

/* Animation for form updates */
.form-row.updated input,
.form-row.updated select {
    animation: highlight 0.5s ease-in-out;
}

@keyframes highlight {
    0% { background-color: #fff3cd; }
    100% { background-color: transparent; }
}

/* Enhanced tooltip styling if needed */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Container improvements */
.cpt-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Form header styling */
.cpt-container h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
    border-bottom: 3px solid #4CAF50;
    padding-bottom: 10px;
}