/**
 * CFM Frontend Styles
 * 
 * @package CFM
 * @since 2.0.0
 */

.cfm-form {
    max-width: 100%;
    margin: 20px 0;
}

.cfm-form .form-group {
    margin-bottom: 15px;
}

/* Flexbox desteği - Yan yana input'lar için */
.cfm-form .form-group.name-email {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.cfm-form .form-group.name-email > div {
    flex: 1;
    min-width: 200px;
}

.cfm-form .form-group.name-email > div label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.cfm-form .form-group.name-email > div input {
    width: 100%;
}

.cfm-form label.cfm-detail-only {
    display: none !important;
}

.cfm-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.cfm-form input[type="text"],
.cfm-form input[type="email"],
.cfm-form input[type="tel"],
.cfm-form input[type="number"],
.cfm-form textarea,
.cfm-form select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.cfm-form textarea {
    min-height: 100px;
}

.cfm-form button[type="submit"] {
    background: #0073aa;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.cfm-form button[type="submit"]:hover {
    background: #005a87;
}

/* Repeatable fields */
[data-repeatable] {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    background: #f9f9f9;
}

/* Tablo formatında repeatable fields */
.cfm-repeatable-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.cfm-repeatable-table thead {
    background: #f5f5f5;
}

.cfm-repeatable-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.cfm-repeatable-table th:last-child {
    text-align: center;
    width: 60px;
}

.cfm-repeatable-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.cfm-repeatable-table tbody tr:hover {
    background-color: #f9f9f9;
}

.cfm-repeatable-table tbody tr:last-child {
    border-bottom: none;
}

.cfm-repeatable-table tbody tr.cfm-repeatable-template {
    display: none;
}

.cfm-repeatable-table td {
    padding: 12px 15px;
    vertical-align: middle;
}

.cfm-repeatable-table td:last-child {
    text-align: center;
    padding: 8px;
}

.cfm-repeatable-table td input[type="text"],
.cfm-repeatable-table td input[type="email"],
.cfm-repeatable-table td input[type="tel"],
.cfm-repeatable-table td input[type="number"],
.cfm-repeatable-table td textarea,
.cfm-repeatable-table td select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    margin: 0;
}

/* Sil butonu - Tablo formatı için */
.cfm-repeatable-table .cfm-repeat-remove {
    background: #dc3232;
    color: #fff;
    border: none;
    padding: 6px 8px;
    border-radius: 3px;
    cursor: pointer;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    transition: background-color 0.2s ease;
}

.cfm-repeatable-table .cfm-repeat-remove:hover {
    background: #a00;
}

.cfm-repeatable-table .cfm-repeat-remove .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}

/* Div formatı için sil butonu (eski stil) */
.cfm-repeat-remove {
    background: #dc3232;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    margin-top: 10px;
}

.cfm-repeat-remove:hover {
    background: #a00;
}

[data-repeat-add] {
    background: #46b450;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 15px;
}

[data-repeat-add]:hover {
    background: #3a9e42;
}

/* Messages */
.cfm-form-messages {
    margin-top: 15px;
}

.cfm-message {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 10px;
}

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

.cfm-message.cfm-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.cfm-message.cfm-loading {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsive - Tablo formatı için mobil görünüm */
@media screen and (max-width: 768px) {
    .cfm-repeatable-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .cfm-repeatable-table thead {
        display: none;
    }
    
    .cfm-repeatable-table tbody {
        display: block;
    }
    
    .cfm-repeatable-table tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
        padding: 10px;
        background: #f9f9f9;
    }
    
    .cfm-repeatable-table tbody td {
        display: block;
        padding: 8px 0;
        text-align: left;
        border-bottom: 1px solid #eee;
    }
    
    .cfm-repeatable-table tbody td:last-child {
        text-align: left;
        padding: 10px 0 0 0;
        border-bottom: none;
    }
    
    .cfm-repeatable-table tbody td:before {
        content: attr(data-label);
        font-weight: 600;
        display: block;
        margin-bottom: 5px;
        color: #666;
        font-size: 12px;
        text-transform: uppercase;
    }
    
    .cfm-repeatable-table tbody td:last-child:before {
        display: none;
    }
}

